Use php directly to implement pseudo-static page code without mod_rewrite

Source: Internet
Author: User
Without mod_rewrite, you can directly use php code to implement pseudo-static effects. after reading it, you will find that php is really convenient to Rewrite Pseudo-static data.

Use the following code during program initialization:
The code is as follows:
$ Php2Html_FileUrl = $ _ SERVER ["REQUEST_URI"];
$ Php2Html_UrlString = str_replace ("/", "", strrchr ($ Php2Html_FileUrl ,"/"));
$ Php2Html_UrlQueryStrList = explode ("@", $ Php2Html_UrlString );
Foreach ($ Php2Html_UrlQueryStrList as $ Php2Html_UrlQueryStr)
{
$ Php2Html_TmpArray = explode ("|", $ Php2Html_UrlQueryStr );
$ _ GET [$ Php2Html_TmpArray [0] = $ Php2Html_TmpArray [1];
}
Echo false static: $ _ GET variable
;
Print_r ($ _ GET );
?>


Then the $ _ GET variable is called in php as usual.
Connection usage:
* ***. Php/param1 | 1234 @ param2 | 4321
And ***. php? Param1 = 1234 & param2 = 4321.

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.