简体   繁体   中英

Simple 301 Redirect in Web.Config (IIS)

I've browser a lot of similar questions here, but most have complicated parameters associated with them. I'm just looking to 301 redirect one link to another on the same domain. The to and from links are very specific, so I don't need to account for any wildcards.

In web.config what would be the appropriate way to 301 redirect /locations/100-denver to /locations/denver?

<configuration>
    <system.webServer>
        <rewrite>
            <rewriteMaps>
                <rewriteMap name="Redirects">
                    <add key="/test.aspx" value="/test2.aspx" />
                    <add key="/aboutus.aspx" value="/about" />
                </rewriteMap>
            </rewriteMaps>
        </rewrite>
    </system.webServer>
</configuration>

I was just researching a similar subject and found this answer on another page: enter link description here

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