I am wondering how one goes about creating/rerouting my custom developed .ASPX pages on IIS 6.0 pages to something totally custom w/o the .aspx extension, say, .vato? For example, instead of my page saying: Default.aspx?ID=123, I would like users to see: Default.vato?ID=123.
我想知道如何在IIS 6.0页面上创建/重新路由我自定义开发的.ASPX页面到完全自定义的.aspx扩展名,比如说.vato?例如,我希望用户看到:Default.vato?ID = 123,而不是我的页面说:Default.aspx?ID = 123。
What concept is? Is this doable? Where can I research more on this topic?
什么概念?这可行吗?我在哪里可以更多地研究这个主题?
3 个解决方案
#1
Yeah, read this:
是的,请阅读:
Create a new entry for your new extension and map it to the same executable as the .aspx handler.
为新扩展创建一个新条目,并将其映射到与.aspx处理程序相同的可执行文件。
The common one is to add a wildcard. This allows you to have URLs without extensions at all. IMO, that's much preferred because extensions make little sense on the internet.
常见的是添加通配符。这允许您拥有没有扩展名的URL。 IMO,这是首选,因为扩展在互联网上没什么意义。
#2
It's not so much a .net question as it is an IIS question.
这不是一个.net问题,因为它是一个IIS问题。
Basically, IIS looks at what extension is being requested and responds accordingly.
基本上,IIS会查看正在请求的扩展名并进行相应的响应。
There is a list of all file extensions and what actions should be taken when these are requested. In terms of .net, these are .aspx, .ascx, asmx, etc. These are basically ISAPI filters.
有一个所有文件扩展名列表,以及在请求这些文件扩展名时应采取的操作。就.net而言,这些是.aspx,.ascx,asmx等。这些基本上是ISAPI过滤器。
Depending on your version of IIS. If you open IIS Manager, choose the website in question, go to Properties, then Home Directory, then Configuration, under Mappings you will see all file extensions and the application that will be called to action this request.
具体取决于您的IIS版本。如果您打开IIS管理器,请选择相关网站,转到“属性”,然后选择“主目录”,然后选择“配置”,在“映射”下,您将看到所有文件扩展名以及将被调用以执行此请求的应用程序。
Therefore, if you add an entry for .vato, and point it to your version of .net, such as C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll then the .vato file will then be treated the same as a .aspx files.
因此,如果您为.vato添加一个条目,并将其指向您的.net版本,例如C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_isapi.dll,那么.vato文件将被处理与.aspx文件相同。
#3
In IIS (6.0) click on "Configuration" on your Web Site page and you can add mappings there. It must reference the same ASP.NET ISAPI DLL as for example the ASPX pages.
在IIS(6.0)中,单击“网站”页面上的“配置”,然后可以在其中添加映射。它必须引用相同的ASP.NET ISAPI DLL,例如ASPX页面。
You can also add * and have all requests route to a HTTP module but that's a little more advanced and useful for the likes of REST.
您还可以添加*并将所有请求路由到HTTP模块,但这对于REST类似的更高级和有用。
#1
Yeah, read this:
是的,请阅读:
Create a new entry for your new extension and map it to the same executable as the .aspx handler.
为新扩展创建一个新条目,并将其映射到与.aspx处理程序相同的可执行文件。
The common one is to add a wildcard. This allows you to have URLs without extensions at all. IMO, that's much preferred because extensions make little sense on the internet.
常见的是添加通配符。这允许您拥有没有扩展名的URL。 IMO,这是首选,因为扩展在互联网上没什么意义。
#2
It's not so much a .net question as it is an IIS question.
这不是一个.net问题,因为它是一个IIS问题。
Basically, IIS looks at what extension is being requested and responds accordingly.
基本上,IIS会查看正在请求的扩展名并进行相应的响应。
There is a list of all file extensions and what actions should be taken when these are requested. In terms of .net, these are .aspx, .ascx, asmx, etc. These are basically ISAPI filters.
有一个所有文件扩展名列表,以及在请求这些文件扩展名时应采取的操作。就.net而言,这些是.aspx,.ascx,asmx等。这些基本上是ISAPI过滤器。
Depending on your version of IIS. If you open IIS Manager, choose the website in question, go to Properties, then Home Directory, then Configuration, under Mappings you will see all file extensions and the application that will be called to action this request.
具体取决于您的IIS版本。如果您打开IIS管理器,请选择相关网站,转到“属性”,然后选择“主目录”,然后选择“配置”,在“映射”下,您将看到所有文件扩展名以及将被调用以执行此请求的应用程序。
Therefore, if you add an entry for .vato, and point it to your version of .net, such as C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll then the .vato file will then be treated the same as a .aspx files.
因此,如果您为.vato添加一个条目,并将其指向您的.net版本,例如C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_isapi.dll,那么.vato文件将被处理与.aspx文件相同。
#3
In IIS (6.0) click on "Configuration" on your Web Site page and you can add mappings there. It must reference the same ASP.NET ISAPI DLL as for example the ASPX pages.
在IIS(6.0)中,单击“网站”页面上的“配置”,然后可以在其中添加映射。它必须引用相同的ASP.NET ISAPI DLL,例如ASPX页面。
You can also add * and have all requests route to a HTTP module but that's a little more advanced and useful for the likes of REST.
您还可以添加*并将所有请求路由到HTTP模块,但这对于REST类似的更高级和有用。