宝塔配置伪静态
1、第一步
Nginx 配置方法:
location ~* \.(htm)$ {
rewrite "^(.*)/(.+?).htm(.*?)$"$1/index.php?$2.htm$3last;
}
![](https://img.haomeiwen.com/i5206843/60dd45b774d9d1c4.png)
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>
![](https://img.haomeiwen.com/i5206843/0150b44271a9d549.png)
2、第二步
1.进入 网站 根目录( /www/wwwroot/www.xxxxxx.com/conf ) 找到conf.php 文件 打开 编辑
2.104行:0 改为 1 保存即可
![](https://img.haomeiwen.com/i5206843/a0fff8316e7f522a.png)
![](https://img.haomeiwen.com/i5206843/a5284083acc204a2.png)
网友评论