创意电子

标题: 「路行学习」discuz 论坛程序实现伪静态的方法 [打印本页]

作者: 刘伟    时间: 2020-10-6 02:20
标题: 「路行学习」discuz 论坛程序实现伪静态的方法
1、点击管理后台——全局——SEO设置——URL静态化


                               
登录/注册后可看大图
路行人
2、将所有选项打勾,并且设置“仅对游客有效”为否,然后提交


                               
登录/注册后可看大图
路行人

                               
登录/注册后可看大图
路行人
3、点击DISCUZ论坛提供的伪静态代码链接,里面提供了很多的伪静态代码


                               
登录/注册后可看大图
路行人
4、如果你用的(虚拟主机用户)”可直接复制下面的代码

# 将 RewriteEngine 模式打开

RewriteEngine On

RewriteBase /



# Rewrite 系统规则请勿修改

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page%3D$3&page=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^blog-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(fid|tid)-([0-9]+).html$ archiver/index.php?action=$1&value=$2&%1

5、在电脑桌面上新建一个文本文档,命名为456.txt;将上一步复制的代码粘贴到456.txt中;

6、将456.txt文件通过FTP上传到自己网站空间根目录下,然后重命名为“.htaccess”;

7、如果按照上面方法设置后,论坛帖子页面打不开,说明是你使用的网站主机不适用这段伪静态代码。





欢迎光临 创意电子 (https://www.wxcydz.cc/) Powered by Discuz! X3.4