如何在ASP.NET中重写URL?
我希望用户能够转到http://www.website.com/users/smith而不是http://www.website.com/?user=smith
解决方法
尝试管理融合网址重写器和反向代理:
http://urlrewriter.codeplex.com
重写的规则是:
# clean up old rules and forward to new URL RewriteRule ^/?user=(.*) /users/$1 [NC,R=301] # rewrite the rule internally RewriteRule ^/users/(.*) /?user=$1 [NC,L]