Simple Rewrite Rule for multiple Domains

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 19 Mar 2013, 18:38

Simple Rewrite Rule for multiple Domains

19 Mar 2013, 18:45

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?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Simple Rewrite Rule for multiple Domains

19 Mar 2013, 21:54

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

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests