如何处理扩展名的URL在ASP.Net和IIS6
我需要一种方法来写的扩展名的URL。我的服务器是一个共享的主机,IIS6.0版本1 Currenty我使用UrlRewriting.Net DLL,它仅支持IIS7。
I need a way to write the extensionless urls. My server is a Shared Host with IIS6.0 version 1. Currenty I am using UrlRewriting.Net dll,which supports only on IIS7.
我的原始URL是abc.xyz.in/Index.aspx?c=comp_Name;
我的虚拟网址是abc.xyz.in/comp_Name.aspx,但我想它作为abc.xyz.in/comp_Name
My original url is abc.xyz.in/Index.aspx?c=comp_Name; My virtual url is abc.xyz.in/comp_Name.aspx but i want it as abc.xyz.in/comp_Name
是否有可能通过任何其它模块或任何东西。请注意我的主机共享主机。所以我不能无论对我自己配置IIS或者强迫我的管理员进行修改为一样的。
Is it possible via any other module or anything. Please note mine host is shared host. So I cant either configure IIS on my own or force my admin to make modifications for the same.
在IIS6(和旧版本)自定义路由的问题是,他们在默认情况下不会调用ASP.Net模块,除非你所要求的。 ASPX,ashx的,.asmx文件。对于这个使用来检查你正在尝试哪些访问,然后显示正确的页面自定义错误的一些解决方案,但它不是一个非常好的解决方案(但如果你真的想了解更多关于它那边是一个示例在$ C $的CProject:的http:// WWW。codeproject.com /用品/ 44475 / IIS-VS-ASP-NET-URL重写)。
The problem with custom routing in IIS6 (and older versions) is that they by default doesn't invoke the ASP.Net module unless you are asking for a .aspx, .ashx, .asmx file. There are some solutions to this that use a custom error that checks what you were trying to visit and then shows the correct page but it isn't a very nice solution (but if you really want to read more about it there is a sample over at CodeProject: http://www.codeproject.com/Articles/44475/IIS-vs-ASP-NET-URL-Rewriting).
我的建议是要问你的虚拟主机添加一个通配符映射ASP.Net,使其处理所有传入的请求您的网站,你可以写一个正确的路由模块,他们可能没有到,但有在没有坏处问它可以很容易地设置在网站的基础。如果是出了问题,那么你或许应该寻找一个新的虚拟主机提供商,可容纳而不是使您的网站,你目前的虚拟主机为您的网站的需求。
My suggestion would be to ask your webhost to add a wildcard mapping for ASP.Net so that it handles all incoming requests to your site so you can write a proper routing module, they might not have to but there is no harm in asking and it can easily be set up on a site basis. If that is out of the question then you should probably look for a new webhost that can accommodate the needs for your site instead of adapting your site to your current webhost.