Redirect to Sub Directory

Discussion in 'Apache' started by Sarao, Sep 29, 2008.

  1. #1
    Hi,
    I have a portal located at my home directory, I want to kee p it there. I managed to redirect using mod_rewrite when someone accesses the NON-WWW version of my domain. but it keep in the root directory if someone prefixes the www
    Heres the code I am using

    
    RewriteEngine on 
    RewriteBase / 
    RewriteCond %{HTTP_HOST} ^itsaphotog\.com$ [NC] 
    RewriteRule (.*) http://www.itsaphotog.com/home/ [R=301,L]
    
    Code (markup):
     
    Sarao, Sep 29, 2008 IP
  2. seismic2

    seismic2 Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just a slight modification :
    RewriteEngine on 
    RewriteBase / 
    RewriteCond %{HTTP_HOST} ^(www\.)?itsaphotog\.com$ [NC] 
    RewriteRule (.*) http://www.itsaphotog.com/home/ [R=301,L]
    Code (markup):
     
    seismic2, Oct 11, 2008 IP