此时的.htaccess为默认的
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
.htaccess修改为以下之后就能访问
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>
本文介绍如何通过修改.htaccess文件中的rewrite规则,实现对URL的重定向,确保网站能够正确解析并访问到指定的PHP文件。修改后的规则包括开启重写引擎,检查请求的文件或目录是否存在,不存在则将所有请求重写到index.php。
6698

被折叠的 条评论
为什么被折叠?



