$ _ 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 replaced by $ _ SERVER [ORIG_PATH_INFO]. as a result, indexes will be removed based on the $ _ SERVER [PATH_INFO] judgment. php will expire. I only found this phenomenon, but I don't understand why? ----- $ _ Server problem. Why can't I disable index. php if url rewriting fails?
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/

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.