IIS7 Url Rewrite Rule regex to make new path and strip extension
-
05-12-2019 - |
Domanda
How can I create rewrite rule is to achieve the following:
before: content/release/0.9.html
after: release-notes/0.9
right now I'm having:
<rule name="Rewrite rule1 for content">
<match url="^content/release/(.+)$" />
<action type="Rewrite" url="release-notes/{R:1}" />
</rule>
How can I get rid of the ".html" in the "after" output?
Soluzione
Try this:
<rule name="Rewrite rule1 for content">
<match url="^content/release/(.+)\.html$" />
<action type="Rewrite" url="release-notes/{R:1}" />
</rule>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow