Remove file extension in reverse ISAPI Rewrite
-
07-06-2021 - |
Question
So I'm having trouble coming up with a good Regex pattern to remove a file extension from a url with Helicon ISAPI Rewrite. It needs to be able to match any type of extensions and remove it? It most be done in ISAPI do to a lack of.. shall we say control (causing possible case of programmers rage) on the app source. Any Ideas?
Thanks!
Example
Browser URL: www.derp.com/folder/file.aspx --> IIS Request URL: www.derp.com/folder/file
Browser URL: www.derp.com/img/cutepuppy.jpg --> IIS Request URL: www.derp.com/img/cutepuppy
La solution
Try using the following:
RewriteRule ^([^.]+)\..+$ $1 [NC,R=301,L]
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow