如何显示没有扩展名的页面 [英] How Do I Display Pages Without Extension

查看:106
本文介绍了如何显示没有扩展名的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们观察到,在某些页面中,页面的地址不会显示文件扩展名,例如



http://www.youtube.com/watch?v=gwS1tGLB0vc



或没有查询时string



http://mysite.com/about/



请告诉我如何在asp.net中托管我的页面。

We observe that in some pages the address of the page does not show file extension like in

http://www.youtube.com/watch?v=gwS1tGLB0vc

or when there is no query string

http://mysite.com/about/

Kindly advice me how I can host my pages in asp.net like this.

推荐答案

有几个你可以实现这个目标。

- 你可以从代码本身进行Url重写:

http://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net [ ^ ]

- 你可以使用Url Routi ng(在.NET 4.0及更高版本中可用):

http://www.4guysfromrolla.com/articles/012710-1.aspx [ ^ ]

- 或者您可以在IIS上使用URL重写:

http://ruslany.net/2008/09/aspnet-routing -request-filtering-url-rewriting / [ ^ ]
There are several ways you can achieve this.
- You can do Url Rewriting from the code itself:
http://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net[^]
- You can use Url Routing (available in .NET 4.0 and above):
http://www.4guysfromrolla.com/articles/012710-1.aspx[^]
- Or you can use URL Rewrite on IIS:
http://ruslany.net/2008/09/aspnet-routing-request-filtering-url-rewriting/[^]


这篇关于如何显示没有扩展名的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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