Convert An ASPX page to an HTML page

Source: Internet
Author: User

Some websites modify the default Suffix of dynamic pages in IIS for various reasons. In the ASP era, some users modify the configuration on the server and parse the HTML suffix files as ASP files: in other words, the aspprogram (.asp;can save a file with the suffix of .htm to the web directory on the server, and the server still treats it as an ASP program to explain and generate results. In this way, visitors still think that the website is full of HTML pages and is updated frequently (Do you feel unnecessary? Wrong, at least one benefit: Search Engines give priority to HTML pages. In this way, websites can be easily searched by search engines)
It is easy to modify the suffix of ASP file Resolution on the server. You can modify the Suffix in IIS Service Manager> site Properties> Home directory> Configuration> application ing. If you have experience in configuring servers to support PHP, you will be more clear about what is going on.
However, Asp.net won't work. In the same way, after modifying the application ing, we still don't get the expected results. What is the content of the file and what is returned, instead of being processed as an Asp.net program.
In fact, it is a little bit worse, that is, it is not on the web. in the config file or in the C:/Windows/microsoft.net/frameworl/v1.1.4322/config/machine.config (the path under Windows2003 varies slightly with the operating system path, configuration step (assuming we want to add a ing and suffix it. AAA files are treated. ASPX page .) :
Stop the Internet information service in the IIS Service Manager (you can't save the modification without stopping it), and use NotePad to open C:/Windows/microsoft.net/frameworl/v1.1.4322/config/machine.configand find "*. aspx". You can find this line:
The code for this article is as follows:
<Add verb = "*" Path = "*. aspx" type = "system. Web. UI. pagehandlerfactory"/>
The parsing of the. aspx file is configured in this way. In the same way, we only need to add another line and change *. aspx to *. AAA:
The code for this article is as follows:
<Add verb = "*" Path = "*. html" type = "system. Web. UI. pagehandlerfactory"/>
Save the changes and start Internet Information Service. Then, you can change any aspx file to a file suffixed with. AAA.
If you do not want to modify the machine. config file, you can also modify the Web. config file of the website. The method is similar. Add the following configuration under the <configuration> <system. Web> node:
The code for this article is as follows:
<Httphandlers>
<Add verb = "*" Path = "*. html" type = "system. Web. UI. pagehandlerfactory"/>
</Httphandlers>
(You can not) the last point, if it is IIS6 (that is, IIS that comes with Windows2003 ), you have to add a .html mime in the site attribute> HTTP header> MIME type of IIS. Otherwise, the request to .html will be intercepted by IIS first and cannot be displayed.

I have passed the test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.