Welcome to WebmasterWorld Guest from

Forum Moderators: mack

Message Too Old, No Replies

301 redirect root, not sub-directories?

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

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

Junior Member

10+ Year Member

joined:Dec 2, 2003
posts: 45
votes: 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