> -----Original Message----- > From: José Euclides Silva Junior [mailto:euclidesjr2005@xxxxxxxxx] > Sent: Wednesday, August 02, 2006 10:42 PM > To: users@xxxxxxxxxxxxxxxx > Subject: [users@httpd] Hiding directory from the browser address field > > > > ---------- Forwarded message ---------- > From: José Euclides Silva Junior <euclidesjr2005@xxxxxxxxx> > Date: 02/08/2006 17:17 > Subject: Hiding directory from the browser address field > To: users-info@xxxxxxxxxxxxxxxx > > > Hi guys, > i need to hide the application(Java) root directory from the > browser, as you can see at these steps example: > 1) Http request: www.xxxx.com <http://www.xxxx.com/> > 2) Apache runs module Alias: redirect www.xxxx.com > <http://www.xxxx.com/> to www.xxxx.com/somedir/ > <http://www.xxxx.com/somedir/> > 3) App runs and Apache returns www.xxxx.com/somedir/ to the browser You are a bit confused about the relationship between what the browser display in its location bar and what apache sends. Apache doesn't send the contents of the location bar - the browser just displays the URL it requested from the server. Here's how it works: 1) User types in http://server/ 2) browser looks up server in DNS, sends request "GET /", location bar reads http://server/. 3) server gets request, sees it has a redirect rule so responds 301 Redirect to http://server/dir 4) browser gets redirect, makes new request "GET /dir", location bar now reads http://server/dir. 5) server gets this request, fetches content, sends it back 6) browser gets content and displays it 7) location bar still reads http:/server/dir since that's the last thing browser requested. So there is no way to do exactly what you want - the server can't control what the browser displays. However, you may have visited a site that seemed to do that and are wondering how it worked? It cheated and used frames. You basically have a single page at http://server/ that contains a big frame and the frame URL is for the internal content (http://server/dir). So as you navigate through the site, the top level URL doesn't change and all the navigation is handled in the frame (and usually some javascript). The details are out-of-scope on this list (check a frames how-to if you want more info). Note that this "solution" only prevents the URLs appearing in the location bar. They are still visible to the user if he happens to "view-source" and read the HTML... So this isn't any form of security and is only cosmetic. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. > > But, at this thime(step 3) i need to alter some http header > field, because Apache must JUST return " www.xxxx.com > <http://www.xxxx.com/> " to the browser, instead of " > www.xxxx.com/somedir <http://www.xxxx.com/somedir> ". How > coud i do it? Any alias ou rewrite directive available? > Thanks in advance, Euclides. > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx