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.