Some sites for a variety of reasons, in IIS modified the default suffix of dynamic pages, the ASP era, someone on the server to modify the configuration, the HTML suffix file as an ASP file to resolve: that is, ASP programs (. asp) can be saved as a. htm suffix file on the server Web directory, and the server as an ASP program to interpret processing, generate results. In this way, the visitors, also think that the site is full of HTML pages, and often updated it (feel no need to do it?) Wrong, at least one of the benefits: Search engine is a priority to include HTML page Oh, so the site will be very easy to be found in search engine search.
It is easy to modify the suffix on the server to resolve ASP files, which can be modified in the IIS Service Manager-> site Properties-> The home directory-> configuration-> application mappings. If you have the experience of configuring a server to support PHP, then it's better to know what's going on.
But for ASP.net, the same way, to modify the application mapping, still did not get the expected results, what the contents of the file, what is returned is what content, rather than as a asp.net program to deal with.
In fact the main is a little bit worse, that is not in the Web.config file or C:\windows\microsoft.net\frameworl\v1.1.4322\config\ Machine.config (the path under WINDOWS2003, slightly different operating system paths), the HTTP handler for the file with the specific suffix configured (assuming we want to add a mapping to treat the. aspx page with a suffix of. aaa). ):
First stop Internet Information Services in IIS Service Manager (no way to save changes), and then open C:\windows\microsoft.net\frameworl\v1.1.4322\config\ with Notepad Machine.config, look for "*.aspx" to find this line:
The relevant code for this article is as follows:
<add verb= "*" path= "*.aspx"
type= "System.Web.UI.PageHandlerFactory"/>
The parsing of the. aspx file is configured so that, in the same way, we just add one more line and change the *.aspx to *.AAA:
<add verb= "*" path= "*.aaa" type= " System.Web.UI.PageHandlerFactory "/>
Save changes, and then start Internet Information Services. You can modify any ASPX file to be a. aaa file.
If you do not want to modify the Machine.config file, you can also implement it by modifying the Web.config file for the Web site, similar to the <configuration><system.web > node to add the following configuration can be:
This article related to the following code:
& lt;httphandlers>
<add verb= "*" path= "*.aaa" type= "System.Web.UI.PageHandlerFactory"/>
Finally, if it is IIS6 (that is, Windows2003 's own IIS), it is also in the site properties of IIS-> HTTP headers add a. AAA MIME type to the-> MIME type, or you will first be intercepted by IIS when you encounter a request for AAA.