宝塔设置伪静态马马虎虎忙活了一天多时间终于搞明白了

zs163 张帅 关注 五级站长 VIP
发表于SEO相关版块
网站在设置伪静态时使用多种方法在根目录上传伪静态文件,多次无效以后。

无奈尝试使用宝塔网站本身具备伪静态设置端口。

Image

复制一下代码进去

rewrite ^/list-([0-9]+)-([0-9]+)\.html$ /index.php?c=list&sortid=$1&page=$2 last;
rewrite ^/list-high-([0-9]+)-([0-9]+)\.html$ /index.php?c=list&type=high&sortid=$1&page=$2 last;
rewrite ^/user-([0-9]+)\.html$ /index.php?c=user&id=$1 last;
rewrite ^/user-([0-9]+)-([0-9]+)\.html$ /index.php?c=user&id=$1&page=$2 last;
rewrite ^/forum-([0-9]+)\.html$ /index.php?c=forum&id=$1 last;
rewrite ^/center-([0-9]+)\.html$ /index.php?c=center&uid=$1 last;
rewrite ^/center-([0-9]+)-([0-9]+)\.html$ /index.php?c=center&uid=$1&page=$2 last;
rewrite ^/read-([0-9]+)-([0-9]+)\.html$ /index.php?c=read&id=$1&page=$2 last;
rewrite ^/app-([0-9a-zA-Z_]+)-([0-9a-zA-Z_]+)\.html$ /index.php?c=app&a=$1:$2 last;
rewrite ^/downfile-([0-9]+)\.html$ /index.php?c=app&a=puyuetianeditor:index&s=showfile&id=$1 last;
rewrite ^/([a-zA-Z][0-9a-zA-Z_]+)\.html$ /index.php?c=$1 last;
location ~* /logs/.*$ {
	deny all;
}
location ~ \.hst$ {
	deny all;
}
完毕以后保存。

重启网站测试成功。

最后给大家看看我的聚热搜的效果:www.juresou.com

河南,郑州

评论列表 评论
发布评论

评论: 宝塔设置伪静态马马虎虎忙活了一天多时间终于搞明白了

已有0次打赏
(3) 分享
分享

请保存二维码或复制链接进行分享

取消