Forum Moderators: phranque

Message Too Old, No Replies

How do I 301 redirect some domains to my main domain?

Need to do it with htaccess

         

Clint

3:30 pm on Jun 2, 2005 (gmt 0)



For some reason I can't edit my post here [webmasterworld.com...] to reflect the changes needed in the subject line, so I have to start a new one. I got the www and non www issue fixed, but what I need now is for someone to please tell me how to 301 redirect my other domain names to my main domain name. Details on the setup are in the first post of that URL above as well as a paste of my htaccess file.

I came across a webpage that said to do this:
RewriteRule .* [insertURLdirectingto.com...] [R=301,L]
But that didn't work. The fwd'd domain showed "the page cannot be displayed" and when trying to access my main domain it got locked in some sort of a "infinite loop" flashing and the page never loaded.

The NameServers on the domain I want to fwd (the one I'm testing) are set to that of my main domain. I don't even know if that is the correct thing to do.
Thank you.

Clint

3:51 pm on Jun 2, 2005 (gmt 0)



Never mind, I figured it out. I had to go and put all the domain names BACK into the "Parked domains" area of cPanel. I thought that would then make them a 200 redirect, but it does not if you have this line in your htaccess file (which I already did for the www and non-www issue). These lines handle BOTH issues.

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.maindomain\.com
RewriteRule (.*) [maindomain.com...] [R=301,L]