Helicon ISAPI Rewrite + ASP.NET : How to remove . aspx extension?
-
22-09-2019 - |
Question
How do i remove .aspx extension like:
http://www.foo.com/bar --> http://www.foo.com/bar.aspx
http://www.foo.com/bar?q=boo --> http://www.foo.com/bar.aspx?q=boo
Solution
RewriteRule ^([^\.\?]+)/?(\?.*)?$ /$1.aspx$2 [L]
OTHER TIPS
What version of ISAPI_Rewrite you are using - 2 or 3.
The v3 syntax is:
RewriteBase /
RewriteCond %{REQUEST_URI}.aspx -f
RewriteRule ^([^/.]+)$ /$1.aspx [L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow