PhpCI framework routing failure

Source: Internet
Author: User
Accept a project and write it using CI. It can be executed in the local wamp environment. However, when it is placed on an online linux server, the corresponding controller and method cannot be found for the route. After debugging for a while, the root cause is that the variable _ $ SERVER [& #39; SCRIPT_NAME & #39;] has different values in the two environments. For example, the domain name I access is localhostindex. phpab. In the local environment, the $ _ SERVER [& #39; SCRTIPT_NAME & #39;] value is index. php, but the online value is index. phpab, which is the apac Framework php.

Accept a project and write it using CI. It can be executed in the local wamp environment. But when it is placed on an online linux server
The corresponding controller and method cannot be found for the route.
After debugging for a while, the root cause is that the variable _ $ SERVER ['script _ name'] has different values in two environments.
For example, the domain name I access is localhost/index. php/a/B.
The local $ _ SERVER ['scrtipt _ name'] value is/index. php, but the online value is/index. php/a/B.
Apache is used locally and nginx is used online. I would like to ask if the value of all nginx servers is like this, or
Is it because $ _ SERVER ['scrtipt _ name'] has changed because of a special configuration on the SERVER.

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.