PDA

View Full Version : How to 301 redirect an entire website to a single page of a different domain



deadhippo
12-17-2011, 10:59 AM
For a normal site redirect I can add the following line of code to the .htaccess file:


Redirect 301 / http://www.NEWSITE.com/

so i thought that if I used:


Redirect 301 / http://www.NEWSITE.com/SPECIALPAGE/

that it would redirect all pages to
http://www.NEWSITE.com/SPECIALPAGE/

but the results were not quite as expected.

I searched and searched Google but this doesn't seem to be a high demand need.

Does anyone know how to redirect an entire website to a single page of another website using .htaccess (other methods also welcome).

Jean-Luc
12-17-2011, 11:57 AM
Hi,

Try this:

RewriteEngine on
RewriteRule ^.*$ http://www.NEWSITE.com/SPECIALPAGE/ [L,R=301]

Jean-Luc

deadhippo
12-17-2011, 12:06 PM
Thanks. Perfect.

wige
01-12-2012, 05:43 PM
Just as a (faster, lighter, less resource intensive) alternative:

RedirectMatch 301 (.*) http://www.newdomain.tld/newpage.ext