$ _ SERVER-related issues, I said why url rewriting fails and index. php cannot be removed
Source: Internet
Author: User
$ _ SERVER: why can't I disable index because url rewriting fails. after some php host URLs are overwritten, $ _ SERVER ['path _ info'] will disappear and be replaced by $ _ SERVER ["ORIG_PATH_INFO, according to $ _ SERVER ['path _ info'], the problem of $ _ SERVER is determined. Why can't I disable index because url rewriting fails. php
After some host URLs are rewritten
$ _ SERVER ['path _ info'] will disappear,
Instead
$ _ SERVER ["ORIG_PATH_INFO"]
As a result, the removal of index. php will become invalid based on $ _ SERVER ['path _ info '].
I just discovered this phenomenon, but I don't understand why?
------ Solution --------------------
PATH_INFO is missing but ORIG_PATH_INFO is there with the information PATH_INFO was supposed to have.
So the php code had to be changed to check for $ _ SERVER ['orig _ PATH_INFO '] when $ _ SERVER ['path _ info'] is absent
See the last section of http://www.binarytides.com/path_info-orig_path_info-apache-and-php/
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