homepage Welcome to WebmasterWorld Guest from 54.166.95.146
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
301 redirect root, not sub-directories?
How to set .htaccess file to redirect root directory and not subdirectories
donok




msg:4262310
 4:24 pm on Feb 3, 2011 (gmt 0)

Hello --

I have a client who has moved to a new site, but wants to leave sub-direcotry content on the old URL. Right now he has the below code in his .htaccess file, but it is of course redirecting the whol old domain to the new one. How can he set the 301 redirects for the root directory only?


Redirect /index.shtml http://www.new-site.uk/
Redirect / http://www.new-site.uk/
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-site.org.uk$
RewriteRule (.*) http://www.old-site.org.uk/$1 [R=301]


Thanks for any help in advance :-)

-- Don

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved