htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Moved DocumentRoot
PostPosted: 30 Oct 2006 20:32 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
Problem:

Usually the DocumentRoot of the webserver directly relates to the URL "/". But often this data is not really of top-level priority.

For example, you may wish for visitors, on first entering a site, to go to a particular subdirectory /about/. This may be accomplished using the following ruleset:

Solution:

We redirect the URL / to /about/:

Code:
    RewriteEngine on
    RewriteRule   ^/$  /about/  [R]


Note that this can also be handled using the RedirectMatch directive:
Code:
RedirectMatch ^/$ http://example.com/e/www/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB