Forum Moderators: phranque

Message Too Old, No Replies

Redirect to homepage on different domain

rewriterule redirect new domain

         

shady

1:05 pm on Jan 18, 2007 (gmt 0)

10+ Year Member



My apologies if this has been asked a million times before - I have looked and not found the solution :-(

I wish to redirect all pages from an old website to the homepage of a new website, with no parameters.

I have so far:

RewriteEngine on
RewriteRule (.*) [NEWDOMAIN.co.uk...] [R=301,L]

The problem I have is URLs like
[OLDDOMAIN.co.uk...]
redirect to
[NEWDOMAIN.co.uk...]
I want it to go to
[NEWDOMAIN.co.uk...] or [NEWDOMAIN.co.uk...]

Thanks in advance

Shady!

jdMorgan

5:08 pm on Jan 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Simply append a question mark to the substitution URL. This will remove the current query string.

RewriteEngine on
RewriteRule .* http://www.NEWDOMAIN.co.u[b]k/?[/b] [R=301,L]

That's the answer to your technical question, but redirecting all pages to a single page may look like an attempt to use doorway pages, and I cannot recommend doing this. Instead, consider redirecting each page on the old domain to its logical replacement on the new domain, or to a related-category page. If no such replacements exist, then redirecting to the new domain's Site Map page may be an option. As a last resort, return a 404-Not Found or 410-Gone response for non-replaced pages, and provide a link (or links) on your custom 404/410 error pages to the Site Map and/or Home Page on the new domain.

See this current thread [webmasterworld.com] for more discussion.

Jim