What is the significance of this sentence?

Source: Internet
Author: User
What is the significance of this sentence? if (isset ($ _ SERVER ['http _ X_REWRITE_URL ']) {
$ _ SERVER ['request _ URI '] = $ _ SERVER ['http _ X_REWRITE_URL'];
$ ___ S = explode (".", $ _ SERVER ['request _ URI ']);
$ ____ S = explode ("? ", $ _ SERVER ['request _ URI ']);
$ _ SERVER ['path _ info'] = $ ____ s [0];
$ GLOBALS ['is _ iis '] = true;
}
If the redirection is completed, then ..................


Reply to discussion (solution)

In the IIS environment, $ _ SERVER ["HTTP_X_REWRITE_URL"] is used to redirect domain names, instead of $ _ SERVER ['request _ URI ']. in the apache environment, the opposite is true.
This code is used to prevent the value of $ _ SERVER ['request _ URI '] from being different in different environments. this global variable may be used in the code for routing.

In the IIS environment, $ _ SERVER ["HTTP_X_REWRITE_URL"] is used to redirect domain names, instead of $ _ SERVER ['request _ URI ']. in the apache environment, the opposite is true.
This code is used to prevent the value of $ _ SERVER ['request _ URI '] from being different in different environments. this global variable may be used in the code for routing.



In the IIS environment, $ _ SERVER ["HTTP_X_REWRITE_URL"] is used to redirect domain names, instead of $ _ SERVER ['request _ URI ']. in the apache environment, the opposite is true.
This code is used to prevent the value of $ _ SERVER ['request _ URI '] from being different in different environments. this global variable may be used in the code for routing.


The general intention is clear, but I still have a few questions. please answer:
1. what is is_iis? I printed it and there is no result.
2. Why can't HTTP_X_REWRITE_URL be printed in the global array?
3 $ ___ s = explode (".", $ _ SERVER ['request _ URI ']); it does not seem to play any role in judgment, because no other variable equals him,
Thank you.

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.