Simple Rewrite Rule for multiple Domains
2 posts
• Page 1 of 1
Simple Rewrite Rule for multiple Domains
Hi,
I currently have 2 domains pointing to the one site in my iis configuration.
I want the domain to be accessed only through the main domain name but keep all the relatives links as the second domain also have ranks on google.
The rule I currently have is:
RewriteCond %{HTTP_HOST} !^www\.maindomain\.com
RewriteRule (.*) http://www.maindomain.com/$1 [R=301,L]
And it seems to work fine for the www.seconddomain.com
But how do I also get it to work for the seconddomain without the www.
Should that also work for any url maindomain.com redirecting them to the www. version?
I currently have 2 domains pointing to the one site in my iis configuration.
I want the domain to be accessed only through the main domain name but keep all the relatives links as the second domain also have ranks on google.
The rule I currently have is:
RewriteCond %{HTTP_HOST} !^www\.maindomain\.com
RewriteRule (.*) http://www.maindomain.com/$1 [R=301,L]
And it seems to work fine for the www.seconddomain.com
But how do I also get it to work for the seconddomain without the www.
Should that also work for any url maindomain.com redirecting them to the www. version?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Simple Rewrite Rule for multiple Domains
Hello,
You will find a rule to redirect non-www version of your domain to www in our FAQ - http://www.helicontech.com/forum/10648-FAQ.html
I believe you made a mistake in your rule, it seems like you have maindomain redirected to maindomain. loop?
Regards
Andrew
You will find a rule to redirect non-www version of your domain to www in our FAQ - http://www.helicontech.com/forum/10648-FAQ.html
I believe you made a mistake in your rule, it seems like you have maindomain redirected to maindomain. loop?
Regards
Andrew
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests