Answer the question
In order to leave comments, you need to log in
Why doesn't ASP site redirect from WWW?
Hello! There is a site (asp mvc 5) - poster when the site was a simple shared hosting, this code worked to redirect from www to non-www:
<rewrite>
<rules>
<rule name="Remove WWW" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{CACHE_URL}" pattern="*://www.*" />
</conditions>
<action type="Redirect" url="{C:1}://{C:2}" redirectType="Permanent" />
</rule>
<!--<rule name="Redirect to non-www" stopProcessing="true">
<match url="(.*)" negate="false"></match>
<action type="Redirect" url="http://city-afisha.com/{R:1}"></action>
<conditions>
<add input="{HTTP_HOST}" pattern="^city-afisha.com$" negate="true"></add>
</conditions>
</rule>
-->
</rules>
</rewrite>
Answer the question
In order to leave comments, you need to log in
it seems to me that you have a problem in <add input="{CACHE_URL}" pattern="*://www.*" />
Tat, it seems that there should be a regular expression, and you have a string.
If you look at:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question