Why can't index.php be omitted in domain name access?
kevinchow2018-03-02 11:36:09
0
9
1954
Why can’t index.php be omitted in domain name access? For example: http://tp5.com/index.php/index/index/index. If index.php is omitted, it cannot be accessed. How to modify it?
This is the reason for the framework. index.php is the entry file. As you can understand from the name, all requests to this website must first go through this script
replyI haven’t reached the routing yet. I can’t use the .htaccess file to achieve it. But I can achieve it in the video. I checked the manual and found that in the Apache configuration, there is no configuration item in studyphp.
Change the last line RewriteRule in the .htaccess file in the Public folder to RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] to hide the entry file
As mentioned on the first floor, if you want to omit index.php, you need to configure url rewriting and add .htaccess
This is the reason for the framework. index.php is the entry file. As you can understand from the name, all requests to this website must first go through this script
Is the index file index.php? If not, check whether it exists and its priority.
During routing processing, when $_SERVER['PATHINFO'] does not exist, are the default controller set to index and the default method set to index?
Through url rewriting, the server usually needs to enable the url_rewrite module to support