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.