Add www in-front of your domain using IIS
If you are using IIS you can use the snippet below in your web.config to add www. in-front of your domain if it is not already present.
Please keep in mind that to use the snippet below you will need to have URL Rewrite module installed and enabled.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to www" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^www\.<your domain>\.com$" negate="true" /> </conditions> <action type="Redirect" url="https://www.<your domain>.com/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |
Leave a Reply