Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Problem with redirecting traffic from www3 to www

$
0
0

Hello

I implemented the non-www to www rule as suggested elsewhere in the forum and it works great. It redirects requests for domain.com towww.domain.com. This is associated with the IIS Site domain.com.

However, I now have a new problem. I also need to redirect requests for www3.domain.com towww.domain.com. This rule is associated with the IIS Site www3.domain.com. Unfortunately, it seems that my original non-www to www rule is catching the incoming requests for and redirecting them (incorrectly). I am not sure this is the case. I could just have my rule for redirecting from www3.domain.com towww.domain.com written incorrectly

Currently, with the rules in place below, when I go to http://www3.domain.com it redirects me to http://.domain.com, which doesn't work. It does capture the query string, but it doesn't change www3 to www, which is basically all I need it to do.

Anyone have any thoughts on what I am doing wrong here?

<configuration><system.webServer><rewrite><rules><rule name="Redirect domain.com to www" patternSyntax="ECMAScript" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^domain.com$" /></conditions><action type="Redirect" url="http://www.domain.com/{R:0}" /></rule></rules></rewrite></system.webServer></configuration>

<configuration><system.webServer><rewrite><rules><rule name="Redirect to www.domain.com" enabled="true" patternSyntax="Wildcard" stopProcessing="true"><match url="www3*" /><conditions><add input="{HTTP_HOST}" pattern="www3.domain.com*" /></conditions><action type="Redirect" url="http://www.domain.com/{C:1}" /></rule></rules></rewrite></system.webServer></configuration>





Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>