简体   繁体   中英

Mass 301 Redirects for IIS product39/user-manual.html > product39/user-manual/

What is the best way to implement Mass 301 Redirects for IIS to move only pages that end in .html to the page name folder for many pages in a large site? I am using Windows Server 2016.

For example:

product56/download.html > product56/download/

product56/user-manual.html > product56/user-manual/

However, if index.html is specified it should not redirect to the folder, but the root, for example:

product47/index.html > product47/

And then I also have 300 or so individual aspx pages that need to redirect to custom URLs, for example:

cart/Label-Software-P590.aspx > products/label-software/niceware/

In my opinion, you could use IIS url rewrite to achieve your requirement, you could download it from this url .

product56/download.html > product56/download/ product56/user-manual.html > product56/user-manual/

Url rewrite contains the friendly url, you could use it to achieve your requirement. Details you could refer to this article:

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/user-friendly-url-rule-template

For the specified html, you should write the custom url by yourself.

For example:

product47/index.html > product47/

    <rewrite>
        <rules>
            <rule name="inde" stopProcessing="true">
                <match url="product47/index.html" />
                <action type="Redirect" url="http://yourdomian/product47/" />
            </rule>
        </rules>
    </rewrite>

cart/Label-Software-P590.aspx > products/label-software/niceware/

    <rewrite>
        <rules>
            <rule name="inde2x" stopProcessing="true">
                <match url="cart/Label-Software-P590.aspx" />
                <action type="Redirect" url="http://yourdomian/products/label-software/niceware/" />
            </rule>
        </rules>
    </rewrite>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM