如何在ASP.NET中重写URL [英] How to rewrites URLs in ASP.NET

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

问题描述

我一直在使用Helicon重写我的URL,它们位于文件htaccess(无点)中.重写过程类似于:

RewriteRule /e-commerce /e-commerce.asp [I,U]

我已经阅读了一些答案,从在C#中重命名文件

如何在.NET中重命名文件?

在ASP.NET/C#中重写URL

在asp.net中自定义网址重写

我看过几个文件名,但我不知道使用哪个文件名.我确定那里有一个与我相匹配的问题,但是经过几个小时的考察,我希望一些专家能够为我提供帮助.

谢谢!

解决方案

您应该尝试URLRewriter.Net.集成到asp.net项目中非常容易.代替IIS级别,它在asp.net级别实现URL重写.

I have been using Helicon to rewrite my URLs and they are in a file htaccess (no dot). The rewrite goes something like:

RewriteRule /e-commerce /e-commerce.asp [I,U]

I have read a few answers, starting with How to Determine the Installed ASP.NET Version of Host from a Web Page. I ran the page, and it displayed 2.0.50727.3643

A little history so maybe one can be gentle. I was a Microsoft Frontpage MVP, but disliked their Frontpage Server Extensions (FPSE). Some hosting companies are still using them, but the last ones were back in 2002.

I was a Microsoft guy. So I went with Microsoft servers and started using ASP includes. Then I came across Helicon - and used it for 4-5 yrs. Some of my sites are having no issues, but some of them are. And my new prices along with new hardware for credit card processing is out and I really need help (BTW, I looked for an e-commerce section but found nothing if y'all have one, I'll be more than happy to help).

I do not even know what is the file name I should be using and the information that goes in there.

Rename a file in C#

How to rename a file in .NET?

Rewriting URLs in ASP.NET/C#

Custom Url Rewriting in asp.net

I have seen several file names but I do not know which one to use. I am sure there is a question out there that matches mine, but after looking for several hours, I am hoping some of the experts will be able to help me out.

Thank you!

解决方案

You should give a try to URLRewriter.Net. It's very easy to integrate into asp.net project. Instead of IIS level it implements url rewriting at asp.net level.

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

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