Pseudo-static rewrite rules

Source: Internet
Author: User
To obtain a pseudo static rewrite rule to achieve the function is as follows: a virtual space, three domain names want to create three sites such as http://a.comhttp: // B. comhttp: // c.com to achieve: Access: http://a.com is actually access to the virtual space root directory in: index.htm access: http:// B .com is actually seeking a pseudo static override rule
The following functions are available:

One virtual space, three domain names want to build three websites

For example

Http://a.com
Http:// B .com
Http://c.com

To achieve this:
Access: The http://a.com is actually accessing: index.htm in the virtual space root directory
Access: The http:// B .com is actually accessing the: index.htm under the virtual space root directory under the B folder
Access: The http://c.com is actually accessing the: index.htm under the c folder under the virtual space root directory


------ Solution --------------------
I just saw your message.

I don't know much about pseudo-static writing, but you can.
Directly include.

PHP code
function curPageURL(){    $pageURL = 'http';    if (isset($_SERVER["HTTPS"])&&($_SERVER["HTTPS"] == "on")) {        $pageURL .= "s";    }    $pageURL .= "://";    if ($_SERVER["SERVER_PORT"] != "80") {        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];    }    else {        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];    }    return $pageURL;}$url=curPageURL();switch ($url){    case 'http://a.com':        include 'index.htm';        break;    case 'http://b.com':        include './b/index.htm';        break;    default:        include 'index.htm';        break;}

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.