NodsDorf Posted May 24, 2010 Posted May 24, 2010 I need to 301 redirect www.thesite.net thesite.net thesite.com to www.thesite.com appending the specific page to the url. I have the following RewriteEngine On RewriteCond %{HTTP_HOST} ^thesite.net [NC] RewriteCond %{HTTP_HOST} ^www.thesite.net [NC] RewriteCond %{HTTP_HOST} ^thesite.com [NC] RewriteRule ^(.*)$ http://www.thesite.com/$1 [L,R=301] This does not work, and I don't see any error, granted .htaccess is not my strong point. But if I do any 1 of these conditions individually with the RewriteRule they work. Example: RewriteCond %{HTTP_HOST} ^thesite.com [NC] RewriteRule ^(.*)$ http://www.thesite.com/$1 [L,R=301] Works perfectly. If I join them with another condition they all fail. Anybody know whats up?
NodsDorf Posted May 24, 2010 Author Posted May 24, 2010 Figured it out, I guess there is an [OR] command I wasn't privy to, and the [NC] wasn't really applicable. Issue Fixed RewriteEngine On RewriteCond %{HTTP_HOST} ^thesite.net [OR] RewriteCond %{HTTP_HOST} ^www.thesite.net [OR] RewriteCond %{HTTP_HOST} ^thesite.com RewriteRule ^(.*)$ http://www.thesite.com/$1 [L,R=301]
Recommended Posts
Archived
This topic is now archived and is closed to further replies.