Welcome Guest, Not a member yet? Register   Sign In
Htaccess confusion
#1

[eluser]Bondie[/eluser]
So, I got confused, basically I have around 10 domains that I'm looking to 301 redirect to one main domain, all setup to the same server.

*replaced domain names obviously Wink*
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} (www\.)?domainone\.(com|info)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domaintwo\.(co.uk)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domainthree\.(co.uk)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domainfour\.(co.uk)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domainfive\.(co.uk)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domainsix\.(co.uk)$ [NC]
RewriteCond %{HTTP_HOST} (www\.)?domainseven\.(co.uk)$ [NC]
RewriteRule ^(.*)$ http://www.domainone.co.uk/$1 [R=301,L]

domainone.co.uk is the main domain which I also own domainone.com domainone.info

some of the domains redirect and others don't redirect, I'm not amazing with htaccess, could someone point out what I've obviously done wrong?

Regards,
Jamie
#2

[eluser]Bondie[/eluser]
Solved it myself, if anyone has a similar problem this was what I used:
Code:
RewriteCond %{HTTP_HOST} (www\.)?domainone\.(com|info)$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domainthree\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domaintwo\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domainfour\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domainfive\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domainsix\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} (www\.)?domainseven\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.domainone.co.uk/$1 [R=301,L]

couldn't edit the original post, some message about spam.




Theme © iAndrew 2016 - Forum software by © MyBB