IIS does not require pseudo-static Rewrite components

Source: Internet
Author: User
Tags .url address asp class click code custom customize

IIS to achieve pseudo-static do not need Rewrite components Now iis site can customize the 404 error page, open the local IIS site, view the properties - custom error, find 404 error, double-click to modify the message type URL, Url set as root Directory absolute path to the file.

For example, set the site more directory 404.asp set url to / 404.asp, mainly to modify our modify 404.asp

The principle is as follows

For example, the home page http: //www.**********.com/index.asp, the URL of the article as follows http: //www.**********.com/ Class / show.asp? ID = 12345, write the program as long as deliberately http: //www.**********.com/Class/show.asp? ID = 12345 written, http: // www. **********. com / show / 12345.html

In fact, there is no http: //www.**********.com/show/12345.html this page. Users want to click on this hyperlink, it will automatically call the 404 error page as long as the 404 error reported The page is defined as asp page on it.

Which joined the show.asp? ID = 12345 page Id 12345 Then use the thief to get the contents of the page to change shown in http: //www.**********.com/show/12345.html page On which the most intercepted with / show / and. Html pages if not less than normal err.html error page test address http: //www.**********.com /show/12345.html http: //www.**********.com/Class/show.asp? ID = 12345 The two pages are the same. The following is the 404 error page code to Write other applications are also OK, following a brief introduction: The above is the 404 error page code, get the current value of the URL statement, for example:

The original dynamic address: http: //www.*****.com/post.asp? Id = * just enter an address: http://www.*****.com/post-id-*. html page will return the value: 404; http: //www.*****.com: 80 / post-id - *. html

We can use the replace to 404; http: //www.*****.com: 80 / post-id-filter, the URL value only * .html, and then split it apart. Based,

That last is, sURL (0) is equal to get the value of *, sURL (1) equal to get the value of html, we get the original post.asp file code to get the id value sURL (0), and then save the code in the 404 error Page, which implements the website pseudo-static function

Finally, if you use the vps and the host is no problem, if it is space you need to have a custom 404 function otherwise there is no way to use.

Related Article

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.