Welcome to WebmasterWorld Guest from 54.145.15.213

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

301 redirect root, not sub-directories?

How to set .htaccess file to redirect root directory and not subdirectories

     

donok

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

10+ Year Member



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
 

Featured Threads

Hot Threads This Week

Hot Threads This Month