ASP.NET URL重写 [英] ASP.NET URL Rewriting

查看:168
本文介绍了ASP.NET URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何重写URL在ASP.NET?

How do I rewrite URL's in ASP.NET?

我想用户能够转到 http://www.website.com/users/smith 而不是 http://www.website.com/?user=smith

I would like users to be able to goto http://www.website.com/users/smith instead of http://www.website.com/?user=smith

推荐答案

尝试管理融合网址重写和反向代理服务器:

Try the Managed Fusion Url Rewriter and Reverse Proxy:

HTTP://urlrewriter.$c$cplex.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]

这篇关于ASP.NET URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆