2020-09-24 discuz问题2

本文介绍了如何在Discuz论坛中设置伪静态,以解决动态网址不易被搜索引擎收录的问题。通过登录后台,启用SEO设置,并选择Apache的rewrite规则,将提供的规则添加到.htaccess文件中,然后更新缓存和浏览器缓存,即可实现伪静态。这有助于提高网站的搜索引擎优化。
摘要由CSDN通过智能技术生成

discuz中伪静态问题
存在动态地址的网站不容易被百度收录,伪静态可以解决这个问题。
在discuz中的,登录后台界面,找到SEO设置,先全部勾选设置项,在页面中间右侧,找到rewrite规则,点击进入选择相对应的伪静态规则
在这里插入图片描述
因为使用的是phpstudy来快速搭建环境,这里就选择apache的
在这里插入图片描述
# 将 RewriteEngine 模式打开
RewriteEngine On

# 修改以下语句中的 /discuz 为您的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /discuz

# Rewrite 系统规则请勿修改
RewriteCond %{QUERY_STRING} ^(.)$
RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=KaTeX parse error: Expected 'EOF', got '&' at position 2: 1&̲%1 RewriteCond …
RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^forum-(\w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^blog-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$1&do=blog&id=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^(fid|tid)-([0-9]+).html$ archiver/index.php?action=$1&value=KaTeX parse error: Expected 'EOF', got '&' at position 2: 2&̲%1 RewriteCond …
RewriteRule ^([a-z]+[a-z0-9_]
)-([a-z0-9_-]+).html$ plugin.php?id=$1:$2&%1

在网站存放的空间根目录下新建一个.htaccess文件,将上面的规则放进去,用phpstudy搭建的,网站是放置在WWW下,规则中的RewriteBase /discuz 修改为RewriteBase / ,设置完可以更新缓存,再把浏览器清除下缓存。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值