Forum Moderators: phranque

Message Too Old, No Replies

Rewrite problem - should be easy

         

jrotering

3:19 pm on Jun 6, 2006 (gmt 0)

10+ Year Member



I've been reading documentation on rewrite and redirect directives on-and-off for years, but I can't seem to figure out how to simply do the following:

For ease of management, I want to keep all of the files that SHOULD live in the root directory of my server instead in a subdirectory called 'rootfiles'. Thus a request for www.mysite.com/index.htm would really (behind the scenes) be a request for www.mysite.com/rootfiles/index.htm.

The first part is easy. But where I get stuck is: how do I prevent '/rootfiles/' from showing up in the URL/location window of the browser when these files are requested? I want to preserve the appearance that these files are in fact in the root directory.

I know the solution is going to be of the simple/duh/right-under-my-nose-the-entire-time variety. But I'm giving up on trying to figure it out for myself. Can anyone help me?

jdMorgan

12:51 am on Jun 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer is in your title: Do a server-internal rewrite, rather than an external redirect. An internal rewrite simply changes the filepath associated with a URL-path, and the client is not involved.

Ref: [httpd.apache.org...]

Jim