TP5中隐藏入口文件的问题

使用phpstudy时
tp5中的官方说明是在入口文件的同级目录下添加一个.htaccess文件
文件内容:

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>

这个配置在phpstudy下并没有效果
在phpstudy下.htaccess文件里面的内容应该改成:

<IfModule mod_rewrite.c> 
Options +FollowSymlinks -Multiviews 
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] 
</IfModule>

猜你喜欢

转载自blog.csdn.net/zhou120189162/article/details/80222459