IIS does not use rewrite to implement Static Page

Source: Internet
Author: User

Static pages made with rewrite do not actually exist. iis (Microsoft's WEB server platform) ewrite is unstable and often 404, so this article is available.

Principle: 404 The page type uses php (as the current mainstream development language) (Asp can also), combined with thieves, to achieve Static Page

Use discuz! Example of Forum archiver:
404 program page: http://bbs.pkxp.com/error.php (as the mainstream development language)
Demo: http://bbs.pkxp.com/archiver/
Error. php (as the mainstream development language) source code:

<? Php (as the mainstream development language)
$ Url = $ _ SERVER [QUERY_STRING];
$ Url = str_replace ("404;", "", $ url );
If (! Ereg (archiver, $ url ))
Echo "Error 404 ";
// Display content on the 404 error page
Else {
$ Url = str_replace ("archiver/", "archiver /? ", $ Url );
$ Str = file ("$ url ");
$ Count = count ($ str );
For ($ I = 0; $ I <$ count; $ I ++ ){
$ File. = $ str [$ I];
}
Echo $ file;
// Implement archiver /? Change xx.html to archiver/xx.html
}
?>

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.