tp6访问的时候省略index.php
apache添加的时候可能会遇到 ? 问号的问题,在倒数第二行index.php后面加个?问号
对于Apache服务器,确保启用了 mod_rewrite 模块,并在 .htaccess 文件中添加以下重写规则:
<IfModule mod_rewrite.c> Options +FollowSymlinks -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L] </IfModule>
对于Nginx服务器,在 server 配置块中添加以下内容:

nginx低版本加这段代码
location ~* (runtime|application)/{
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
return 403;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}


浙公网安备 33010602011771号