Forum Moderators: coopster

Message Too Old, No Replies

How to do 301 redirect with exceptions

         

SEOPutte

11:35 am on Nov 20, 2005 (gmt 0)

10+ Year Member



Iīm about to transfer my site to a new domain.
I plan to do a 301 redirect from the old domain to the new one but i have a couple of issues to consider that i donīt know how to solve.

I want all the old pages to redirect to www.newdomain.com, i.e if i goto www.olddomain.com/dir1/page2.html i want the 301 redirect to www.newdomain.com (root level)
But i have one exception, www.oldomain.com/admin/ must remain the same.

Can i solve this with a header redirect only?

DeanC

9:28 pm on Nov 20, 2005 (gmt 0)

10+ Year Member



Untested:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}!^admin$
RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L]