工程师您好!关于云虚拟主机配置Thinkphp伪静态配置的说明或者教程给一份.
经本地测试,apache和
Nginx+php7.0均能正常访问.只在空间上无法正常访问,出现下图错误.本地测试过程中有出现过下图情况.配置伪静态后消失,并正常访问站点
nginx伪静态规则:
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
apache伪静态规则:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteRule ^.env$ - [F]
RewriteRule ^.htaccess$ - [F]
</IfModule>