I used to make a function to get the url. I used the Linux system at the time. It turns out that I can use REQUEST_URI, but the method seems to be different in Windows. Today I saw such an article again, and now I will forward it to you. refer to.
When PHP operates on the Windows IIS platform, some things are different from those under Linux Apache.
I encountered a magical problem today, which is to use $URI=$_SERVER["REQUEST_URI"];
What you see under Linux is the static address of urlrewrite /exy/exk/list-3/
The original address returned under windows is /exy/article.php?page=3
At this time, I discovered that there is a method under windows, HTTP_X_REWRITE_URL
This array does not exist in Linux
Therefore, the code is slightly modified to be compatible with both platforms. (It’s really hard to adapt to changing servers)
The code is as follows
|
Copy code
|
||||
$URI = $_SERVER["HTTP_X_REWRITE_URL"]; |
//print_r($_SERVER);
http://www.bkjia.com/PHPjc/632068.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632068.htmlTechArticleI used to make a function to get the url, and I was using the Linux system. It turned out that I could use REQUEST_URI, but The method seems to be different in windows. Today I saw another article like this...