url rewriting - URL rewrite in IIS 8.5 is not working I'm getting 404 instead -
hi i've configured rewrite rule on iis seems never gets fired i've been working on several hours without luck rule in web config of appplication:
<rewrite> <rules> <rule name="rewrite frienly url snapshot" stopprocessing="true"> <match url="/(localhost:2934)\/trabajos\/([\w-]+)\/([\w-|\-]+)" /> <action type="rewrite" url="\/snapshots/{r:2}.html" logrewrittenurl="true" /> </rule> </rules> </rewrite>
my url following:
http://localhost:2934/trabajos/3ba2a9e4/some-cool-title '
and want rewrite as:
http://localhost:2934/snapshots/3ba2a9e4.html
this result testing pattern in iis:
to me seems ok
but when testing url in browser, feel rule never gets fired, in fact, i've configured trace failed request this tutorial , don't error or file in logs folder. ex: c:\inetpub\logs\failedreqlogfiles
i'm getting 404 error instead , it's logged this:
2015-03-28 18:56:11 ::1 /trabajos/3ba2a9e4/some-cool-tile - 2934 - ::1 mozilla/5.0+(windows+nt+6.3;+win64;+x64)+applewebkit/537.36+(khtml,+like+gecko)+chrome/42.0.2311.60+safari/537.36 - 404 0 2 4 2015-03-28 18:56:15 ::1 /trabajos/3ba2a9e4/some-cool-title - 2934 - ::1 mozilla/5.0+(windows+nt+6.3;+win64;+x64)+applewebkit/537.36+(khtml,+like+gecko)+chrome/42.0.2311.60+safari/537.36 - 404 0 2 2
any ideas?
seems had same issue question changed url pattern , removed slash @ begening of path.
this rule works:
<rewrite> <rules> <rule name="rewrite frienly url snapshot" stopprocessing="true"> <match url="trabajos\/([\w-]+)\/([\w-|\-]+)" /> <action type="rewrite" url="snapshots/{r:1}.html" logrewrittenurl="true" /> </rule> </rules> </rewrite>
Comments
Post a Comment