This is a discussion on RewriteRule or RewriteBase, or both? within the Apache Web Server forums, part of the Web Server and Related Forums category; I need to create a subdirectory beneath document_root called /html where I can server up all html documents. I want ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I need to create a subdirectory beneath document_root called /html
where I can server up all html documents. I want the url in the browser to remain http://www.website.com without the "/html" revealed in the url. The rule below correctly redirects to the /html directory, however the url in the browser looks like http://www.website.com/html/ RewriteRule ^$ http://test.website.com/html/ [R] How can I serve up web pages from /html without is showing up in the browser address field? I read many of the docs on the apache site, but none seem to address this situation. Regards, RelaxedGuy |
|
|||
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 relaxedguy2 wrote: > > RewriteRule ^$ http://test.website.com/html/ [R] > > How can I serve up web pages from /html without is showing up in the > browser address field? I read many of the docs on the apache site, but > none seem to address this situation. They seem to hide well the bit where the "[R]" is defined, but it is there in the reference manual with all the other options. You can rewrite and redirect like you do. If you "just" rewrite without redirecting, the right page is shown and the browser URL never gets a chance to change. So you want a rule to always add "html/" to the beginning of the directory path. Of course why you don't just define this to be the new document root you don't explain. I'm still getting into mod_rewrite, but I think the only way is to play at making it do different things till you understand it well enough to make it do what you want. -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/to70GFXfHI9FVgYRApctAJwK35ji0O9h92Ryukmp4z+QcRtHbA Cfbgy8 4BDKnuLgwRXr4sG51efQr+w= =tu6b -----END PGP SIGNATURE----- |