Access path http://tp6.com/index.php/index/index/admin
尘世*จุ๊บ
尘世*จุ๊บ 2020-05-19 17:35:58
0
2
2835

Why does the path change when I put it under the index file to access it according to the teacher's instructions?

http://tp6.com/index.php/index/index/admin

尘世*จุ๊บ
尘世*จุ๊บ

reply all(1)
!

The entry file mentioned here refers to the public/index.php file. The configuration file is in this directory. You can remove the entry file index.php in the URL address, but you need to configure the rewrite rules of the WEB server additionally. Taking Apache as an example, add the .htaccess file at the same level that requires file entry (the official file comes with it by default), with the following content:

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/ [QSA,PT,L]
</IfModule>
如果用的phpstudy,规则如下:
<IfModule mod_rewrite.c>
 Options +FollowSymlinks -Multiviews
 RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:] 
 </IfModule>

  • reply Hello, thank you for your answer. The problem has been solved, but now you can only access the index method, not the hello method inside. The controller does not exist: app\index\controller\Hello:
    尘世*จุ๊บ author 2020-05-20 12:36:54
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template