宝塔面板,调整方式如下:
这里,宝塔提供了ThinkPHP5的标准指向配置。但是仅仅调整这个是不好用的。
接下来,打开该网站的“配置文件”,添加一段代码(下面会有描述),即可使用。
注意红色部分,是你的域名,所以,你不要全部复制,只需要加入蓝色背景部分即可。
server
{
listen 80;
server_name domain.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/public;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
error_page 404 /404.html;
error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
include enable-php-55.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/domin.conf
#REWRITE-END
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
access_log off;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ .*\.(js|css)?$
{
expires 12h;
access_log off;
}
access_log /www/wwwlogs/domain.log;
error_log /www/wwwlogs/domain.error.log;
}
转载:
因篇幅问题不能全部显示,请点此查看更多更全内容