开发者

Helicon ISAPI Rewrite + ASP.NET : How to remove . aspx extension?

开发者 https://www.devze.com 2022-12-20 22:15 出处:网络
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.开发者_JS百科com/bar.aspx?q=boo RewriteRule ^([^\\.\\?]+)/

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.开发者_JS百科com/bar.aspx?q=boo


RewriteRule ^([^\.\?]+)/?(\?.*)?$ /$1.aspx$2 [L]


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]
0

精彩评论

暂无评论...
验证码 换一张
取 消