宝塔配置伪静态
1、第一步
Nginx 配置方法:
location ~* \.(htm)$ {
rewrite "^(.*)/(.+?).htm(.*?)$"$1/index.php?$2.htm$3last;
}

Apache 配置方法:
RewriteEngine on
# Apache 2.4
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*?)([^/]*)$ $1index.php?$2[QSA,PT,L]
# Apache other
#RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3[L]
RewriteCond %{HTTP_HOST} ^xxx.com [NC]
RewriteRule ^(.*)$ http://www.xxx.com/$1 [L,R=301]
</IfModule>

2、第二步
1.进入 网站 根目录( /www/wwwroot/www.xxxxxx.com/conf ) 找到conf.php 文件 打开 编辑
2.104行:0 改为 1 保存即可


网友评论