简体   繁体   中英

url-rewrite not working with slash

i have a problem for url-rewrite

in my query in web.config is shown below :

    <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

  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

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>

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