简体   繁体   中英

IIS rewrite with querystring

I've changed the URL of my tag page and need to do a redirect using IIS. Can someone please help me?

Old page

/odla/?tag=different keywords

New page

/odla/index/?tag=different keywords

Thanks / Niklas

You need to do a rewrite rule in your web.config:

<rule name="MyRule" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
        <conditions>
            <add input="{REQUEST_URI}" pattern="*/odla/?tag=*"/>
        </conditions>
    <action type="Rewrite" url="http://yourserver/odla/index/?tag={R:2}" />
</rule>

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