简体   繁体   中英

How to pass two URL parameters with IIS 8.5 URL ReWrite module?

I am trying to pass two parameters in the URL with the following url rewrite rule and the page keeps showing 404 error.

Actual URL: https://devbox.mysite.com/kb/article/?slug=view-my-class-schedul&role=56c4cfe091121c0b5b47fe66

I want to show URL on browser: https://devbox.mysite.com/kb/article/view-my-class-schedule

Current URL Rewrite rule that's not working:

<rule name="KB-rewrite" enabled="true">
    <match url="^kb/article/([a-zA-Z0-9\-]+)&amp;role=([a-zA-Z0-9\-]+)$" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{QUERY_STRING}" pattern="1" negate="true" />
    </conditions>
    <action type="Rewrite" url="kb/article/?slug={R:1}&amp;role={R:2}" appendQueryString="false" />
</rule>

Okay, I think I figured it out. The display URL has to be something like: https://devbox.mysite.com/kb/article/view-my-class-schedule/reader . I guess the way I was thinking is not possible.

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