ASP.NET中的URL重写 [英] URL rewriting in ASP.NET
本文介绍了ASP.NET中的URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我正在开发电子商务项目,我的要求是在页面加载地址栏中的上一个URL后重写URL。
Ex:
Dear All,
I am working on ecommerce project and my requirement is to rewrite the URL once the page is loaded with the previous URL in the address bar.
Ex:
Instead of displaying the following URL in the address bar:
http://www.test.com/Product/Product.aspx?groupID=2392&retailerID=12
I need to display:
http://www.test.com/Chocolates-Delicatessen/Chocolates/Nuts/CADBURY/CADBURY-DAIRY-MILK-FRUIT-NUT-TABLET-360G
网址格式为:
主页/ [类别] / [子类别] / [部门] / [品牌名称] / [产品名称]
我用Google搜索并没有得到准确的解决方案。
任何有关示例或建议的帮助都将是非常感激。
谢谢,
The URL format is:
Home / [Category] / [Sub Category] / [Department] / [Brand Name] / [Product Name]
I googled for it and didn't get an accurate solution.
Any help with an example or suggestion would be greatly appreciated.
Thanks,
推荐答案
IIS和ASP.Net本身支持重写。并且还有一些插件可以用于此。
关于这个主题和我最喜欢的一些最好的文章是:
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx [ ^ ]
http://msdn.microsoft .com / zh-CN / library / ms972974.aspx [ ^ ]
http: //www.hanselman.com/blog/RedirectingASPNETLegacyURLsToExtensionlessWithTheIISRewriteModule.aspx [ ^ ]
http:// www。 iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing [ ^ ]
IIS and ASP.Net natively support the re-writing. And there are also some plug-ins which you can use for this.
Some of the best articles on this topic and my favorites are:
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx[^]
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^]
http://www.hanselman.com/blog/RedirectingASPNETLegacyURLsToExtensionlessWithTheIISRewriteModule.aspx[^]
http://www.iis.net/learn/extensions/url-rewrite-module/iis-url-rewriting-and-aspnet-routing[^]
请看这些链接:
ASP.NET中的URL重写
使用URLRewriter.Net重写网址
http://msdn.microsoft .com / zh-CN / library / cc668201%28v = vs.100%29.aspx [ ^ ]
完整的URL重写ASP.NET 2.0解决方案
URL重写使用ASP.NET
提示/技巧:使用ASP.NET重写URL
使用global.asax和web.config在ASP.NET中重写URL
Please see these links:
URL Rewriting in ASP.NET
URL Rewriting with URLRewriter.Net
http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx[^]
A Complete URL Rewriting Solution for ASP.NET 2.0
URL Rewriting with ASP.NET
Tip/Trick: Url Rewriting with ASP.NET
URL Rewriting in ASP.NET using global.asax and web.config
这篇关于ASP.NET中的URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文