Operation method of IIS redirection to domain name with WWW

Considering the user experience, the site will usually be the last to jump. For example, if my website's domain name is botread.com and my homepage is https://www.botread.com, it's easy to use if the web server is iis. Usually, you can just modify the web.config file.

How to redirect iis to the WWW

Add a rule to the site's change directory

<rule name="Redirect to www" stopProcessing="true">
    <match url=".*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^botread.com$" />
    </conditions>
    <action type="Redirect" url="https://www.botread.com/{R:0}" redirectType="Permanent" />
</rule>

 

Leave a Reply

Your email address will not be published. Required fields are marked *