从网址中删除.aspx或重命名 [英] Remove .aspx from url or rename

查看:118
本文介绍了从网址中删除.aspx或重命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从URL中删除.aspx或将其重命名为html或任何扩展名.

预先感谢您

how can i remove the .aspx from the url or rename it into html or any extension.

Thank You In Advance

推荐答案

将原始URL更改为其他URL(通常有意义且易于理解)的技术称为URL重写.有多种方法可以执行此操作.下面很少提及.

1.通过Web.config(http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx)

2.通过路由处理程序(http://www.codeproject.com/Articles/77199/URL-Routing-with-ASP-NET-4-0)

3.通过HTTPModule(http://www.codeproject.com/Articles/33341/URL-Rewriting-using-ASP-NET-for-SEO)


您可以和最适合您要求的任何人一起去.
The technique of changing the original URL to some other URL(generally meaningful and easy to understand) is known as URL rewriting. There are various methods available for doing so. Few are mention below.

1. Via Web.config(http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx)

2. Via Route handler(http://www.codeproject.com/Articles/77199/URL-Routing-with-ASP-NET-4-0)

3. Via HTTPModule(http://www.codeproject.com/Articles/33341/URL-Rewriting-using-ASP-NET-for-SEO)


You can go with anyone which best suit to your requirement.




使用url重写.如何使用它,请参见此处 [


use url rewrieting. How it is used see here [^].


您可以使用MVC,而根本没有文件名.否则,您需要重新映射IIS以考虑选择作为.NET页的任何文件名.对.html执行此操作显然意味着.NET也将解析任何html页面.
You can use MVC and not have filenames at all. Otherwise, you need to remap your IIS to regard whatever filename you choose to be a .NET page. Doing this to .html will obviously mean any html page will be parsed by .NET, too.


这篇关于从网址中删除.aspx或重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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