简体   繁体   English

如何通过IIS 8.5 URL ReWrite模块传递两个URL参数?

[英]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. 我正在尝试使用以下url重写规则在URL中传递两个参数,并且该页面不断显示404错误。

Actual URL: https://devbox.mysite.com/kb/article/?slug=view-my-class-schedul&role=56c4cfe091121c0b5b47fe66 实际网址: 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 我想在浏览器上显示URL: https : //devbox.mysite.com/kb/article/view-my-class-schedule

Current URL Rewrite rule that's not working: 当前的URL重写规则不起作用:

<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 . 显示URL必须类似于: https : //devbox.mysite.com/kb/article/view-my-class-schedule/reader I guess the way I was thinking is not possible. 我想我的想法是不可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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