IP Canonicalization in IIS 8.0 for Redirect From IP to Domain Name
IP Canonicalization in IIS 8.0 for Redirect From IP to Domain Name maybe sometime required if you have deployed your web application on IIS8 along with many other applications then you might need to put this rule to fix the IP Canonicalization issue. I deployed WordPress on IIS8 along with other web applications and found this problem that my IP address is not being redirected towards the domain name even putting all the DNS records in place.
You will get an error message on your SEO tools if you don’t have this record on your server to support your desired website:
I followed the under given method which worked for me:
<rule name="Enforce canonical hostname" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^www\.windowstechupdates\.com$" negate="true" /> </conditions> <action type="Redirect" url="https://www.windowstechudpates.com/{R:1}" redirectType="Permanent" /> </rule>
You have to put this rule in web.config file of your WordPress Installation.
This rule will redirect every query other than www.windowstechupdates.com towards www.windowstechupdates.com because if we don’t put a negate rule for the main URL it will create an infinite loop which ultimately leads towards failure for the website. Hope this post help you to setup your rule. Please find some time to share it with your social media friends.
Note: All information provided on www.windowstechupdates.com are on “as is” basis. please apply to test environments before applying on production environment.