如何在浏览器中删除asp.net扩展? [英] How to Remove asp.net extension in browser?
本文介绍了如何在浏览器中删除asp.net扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在浏览器中显示http://example.com/About
原始:http://示例。 com / About.aspx
i wanted to show http://example.com/About in browser
orginal : http://example.com/About.aspx
推荐答案
您可以在应用程序的Web.config文件中进行URL重写。
请点击以下链接了解更多详情。
使用ASP.NET重写URL [ ^ ]
You can do URL rewriting in Web.config file of the application.
Follow the following link for more details.
URL Rewriting with ASP.NET[^]
1.URL映射
http://msdn.microsoft.com/en-us/library/vstudio/ms228302( v = vs.100).aspx [ ^ ]
2.URl重印
http://www.hanselman.com/blog/RedirectingASPNETLegacyURLsToExtensionlessWithTheIISRewriteModule.aspx [ ^ ]
1.URL mapping
http://msdn.microsoft.com/en-us/library/vstudio/ms228302(v=vs.100).aspx[^]
2.URl rewrinting
http://www.hanselman.com/blog/RedirectingASPNETLegacyURLsToExtensionlessWithTheIISRewriteModule.aspx[^]
使用大多数托管的IIS7 URL重写模块在我的web.config文件中编写以下代码网站现在提供(在这种情况下我使用的是GoDaddy):
..
Write the following code in my web.config file using the IIS7 URL Rewrite Module that most hosted sites now offer (in this case I am using GoDaddy):
..
<rewrite>
<rules>
<rule name="RewriteASPX">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>
</rules>
</rewrite>
...
希望这有助于你/>
谢谢
...
Hope This Helps You
Thanks
这篇关于如何在浏览器中删除asp.net扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文