thinkphp5隐藏apache下的index.php

时间:2025-04-07 20:03:43

在应用入口文件同级目录添加.htaccess文件,内容如下:

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

相关文章