简体   繁体   English

url-rewrite 不能使用斜杠

[英]url-rewrite not working with slash

i have a problem for url-rewrite我有 url-rewrite 的问题

in my query in web.config is shown below :在我的 web.config 查询中,如下所示:

    <rule name="show master">
      <match url="master/([_0-9a-z-]+)/([_0-9a-z-].+)/([^.]*)/([^.]*)/([^.]*)" />
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
      <action type="Rewrite" url="View.aspx?x={R:1}&amp;y={R:2}&amp;w={R:3}&amp;s={R:4}&amp;n={R:5}" />
    </rule>

IF i call this url below is working如果我在下面调用这个 url 正在工作

  https://mydomain/master/xx/yy/ww/ss/12-n

then i call this url below is not working然后我在下面称这个网址不起作用

  https://mydomain/master/xx/yy/ww/ss/12-n/

i know about SLASH , but i need both url is working我知道 SLASH ,但我需要两个 url 都有效

Does this work with adding /?$ /?这是否适用于添加 /?$ /? at end of RegEx在正则表达式的末尾

<rule name="show master"  stopProcessing="true">
  <match url="master/([_0-9a-z-]+)/([_0-9a-z-].+)/([^.]*)/([^.]*)/([^.]*)\/?$" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
  <action type="Rewrite" url="View.aspx?x={R:1}&amp;y={R:2}&amp;w={R:3}&amp;s={R:4}&amp;n={R:5}" />
</rule>

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

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