2020-09-24 discuz问题2

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 / ,设置完可以更新缓存,再把浏览器清除下缓存。