RewriteRule or RewriteBase, or both?

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-13-2003
relaxedguy2
 
Posts: n/a
Default RewriteRule or RewriteBase, or both?

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
  #2 (permalink)  
Old 11-15-2003
Simon Waters
 
Posts: n/a
Default Re: RewriteRule or RewriteBase, or both?

-----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-----

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0