: IIS URL Rewrite Wildcards I have some URLs as follows http://localhost/wordpress/latest/joe/12 http://localhost/wordpress/latest/bloggs/14 http://localhost/wordpress/latest/thing/15 I would like to redirect
I have some URLs as follows
localhost/wordpress/latest/joe/12 http://localhost/wordpress/latest/bloggs/14 localhost/wordpress/latest/thing/15
I would like to redirect them to
localhost/wordpress/file.php?id=12 http://localhost/wordpress/file.php?id=14 localhost/wordpress/file.php?id=15
So latest needs to be in the URL, then it could be anything, then a number
Any advice? I've tried this and although the test is fine, going to the URL doesn't work. I've even tried using a rewrite map but that doesn't work either.
By 'doesn't work' I mean the original URL stays on place.
<rule name="TEST" patternSyntax="ECMAScript" stopProcessing="true">
<match url="/wordpress/latest/(.*)/(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Redirect" url="http://localhost/wordpress/file.php?id=" appendQueryString="false" />
</rule>
ReWrite Map
<rule name="ArticlesRule">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{Articles:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" appendQueryString="false" />
</rule></rules>
<rewriteMaps>
<rewriteMap name="Articles">
<add key="/wordpress/latest/dfjkdskfjdklsf/12" value="/wordpress/?id=12" />
</rewriteMap>
</rewriteMaps>
More posts by @Gretchen104
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.