Answer the question
In order to leave comments, you need to log in
How to make redirect 301 in IIS?
How to redirect 301 for all paths from www.site to site in IIS?
In the web.config configuration file of the www.site site, I add the following entry:
<configuration>
<location path="index.html">
<system.webServer>
<httpRedirect enabled="true" destination="http://site.com" exactDestination="true" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
Answer the question
In order to leave comments, you need to log in
Well, apparently it only works for www.site/index.html because <location path="index.html">
Try it as it says here
Or like this:
<rewrite>
<rules>
<rule name="Redirect domain.com to www" patternSyntax="Wildcard" 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>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question