查看: 2720|回复: 1
收起左侧

▶▶▶Discuz! X3.1 VPS主机、IIS、Linux伪静态规则设置

[复制链接]
发表于 2013-12-21 09:30:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转随县论坛。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
Discuz! X3.1 VPS主机的伪静态httpd.conf规则设置:
(1)服务器系统及 PHP:WINNT / PHP v5.X.X  服务器软件:Microsoft-IIS/6.0
httpd.conf规则设置:
  1. RegistrationName= wlqcwin
  2. RegistrationCode= 2EAD-35GH-66NN-ZYBA




  3. [ISAPI_Rewrite]
  4. # 3600 = 1 hour
  5. CacheClockRate 3600
  6. RepeatLimit 32




  7. # 自定义错误页面




  8. ErrorDocument 404 /404/index.html




  9. # 默认包含了301设置,此设置情况下sxbbs.cn/aa.htm 会301跳至www.sxbbs.cn/aa.htm,将sxbbs.cn替换为您自己的域名就能实现自己的域名的301




  10. # 第一条表示要做跳转的域名,第二条表示要跳转到的域名




  11. RewriteCond %{HTTP:Host} ^sxbbs.cn$
  12. RewriteRule (.*) https://www.sxbbs.cn$1 [NC,R=301]




  13. # 多个域名做跳转的方法:
  14. # 首先复制多个 RewriteCond 项,将域名改好 除了最后一项,其余的 RewriteCond 项最后都要加个参数 [OR]即可。




  15. RewriteCond %{HTTP:Host} ^0722pp.com$[OR]
  16. RewriteCond %{HTTP:Host} ^www.0722pp.com$[OR]
  17. RewriteCond %{HTTP:Host} ^suiw.net$[OR]
  18. RewriteCond %{HTTP:Host} ^www.suiw.net$[OR]
  19. RewriteCond %{HTTP:Host} ^szggmm.com$[OR]
  20. RewriteCond %{HTTP:Host} ^www.szggmm.com$[OR]
  21. RewriteCond %{HTTP:Host} ^shuizhidu.cn$[OR]
  22. RewriteCond %{HTTP:Host} ^www.shuizhidu.cn$[OR]
  23. RewriteCond %{HTTP:Host} ^hao0722.cn$[OR]
  24. RewriteCond %{HTTP:Host} ^www.hao0722.cn$[OR]
  25. RewriteCond %{HTTP:Host} ^hbsztv.cn$[OR]
  26. RewriteCond %{HTTP:Host} ^www.hbsztv.cn$
  27. RewriteRule (.*) https://www.sxbbs.cn$1 [NC,R=301]




  28. # Protect httpd.ini and httpd.parse.errors files
  29. # from accessing through HTTP
  30. # Discuzx3.1
  31. # 主题分类与分类信息伪静态
  32. RewriteCond %{QUERY_STRING} ^(.*)$
  33. RewriteRule ^(.*)/type-(\w+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&typeid=$3&typeid=$3&filter=typeid&page=$4
  34. RewriteCond %{QUERY_STRING} ^(.*)$
  35. RewriteRule ^(.*)/sort-(\w+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&sortid=$3&sortid=$3&filter=sortid&page=$4
  36. #门户专题页伪静态
  37. RewriteCond %{QUERY_STRING} ^(.*)$
  38. RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
  39. #门户文章页伪静态
  40. RewriteCond %{QUERY_STRING} ^(.*)$
  41. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
  42. #论坛主题列表页伪静态
  43. RewriteCond %{QUERY_STRING} ^(.*)$
  44. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
  45. #论坛主题内容页伪静态
  46. RewriteCond %{QUERY_STRING} ^(.*)$
  47. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
  48. #群组主题列表页伪静态
  49. RewriteCond %{QUERY_STRING} ^(.*)$
  50. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
  51. #用户个人主页伪静态
  52. RewriteCond %{QUERY_STRING} ^(.*)$
  53. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
  54. #用户日志内容页伪静态
  55. RewriteCond %{QUERY_STRING} ^(.*)$
  56. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
  57. #论坛 Archiver 页伪静态
  58. RewriteCond %{QUERY_STRING} ^(.*)$
  59. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
  60. #插件伪静态
  61. RewriteCond %{QUERY_STRING} ^(.*)$
  62. RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
复制代码









▶▶▶Discuz! X3.1 VPS主机、IIS、Linux伪静态规则设置linux,伪静态,规则,设置




httpd.ini:
  1. [ISAPI_Rewrite]




  2. # 3600 = 1 hour
  3. CacheClockRate 3600




  4. RepeatLimit 32




  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP
  7. RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
  8. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
  9. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
  10. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
  11. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
  12. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5
  13. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
  14. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5
  15. RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
复制代码

▶▶▶Discuz! X3.1 VPS主机、IIS、Linux伪静态规则设置linux,伪静态,规则,设置








(2)服务器系统及 PHP : Linux / PHP v5.X.X  服务器软件:Apache
.htaccess的规则配置:
  1. <IfModule mod_rewrite.c>
  2. # 将 RewriteEngine 模式打开
  3. RewriteEngine On




  4. ErrorDocument 404 /404/index.html




  5. RewriteCond %{HTTP_HOST} ^sxbbs.cn$ [NC]
  6. RewriteRule ^(.*)$ https://www.sxbbs.cn/$1 [R=301,L]




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




  9. # Rewrite 系统规则请勿修改
  10. RewriteEngine On




  11. RewriteCond %{QUERY_STRING} ^(.*)$
  12. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
  13. #Discuz!门户专题伪静态
  14. RewriteCond %{QUERY_STRING} ^(.*)$
  15. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topicid=$2&%1
  16. #论坛其他伪静态
  17. RewriteCond %{QUERY_STRING} ^(.*)$
  18. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
  19. RewriteCond %{QUERY_STRING} ^(.*)$
  20. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
  21. RewriteCond %{QUERY_STRING} ^(.*)$
  22. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
  23. RewriteCond %{QUERY_STRING} ^(.*)$
  24. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
  25. RewriteCond %{QUERY_STRING} ^(.*)$
  26. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
  27. RewriteCond %{QUERY_STRING} ^(.*)$
  28. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
  29. RewriteCond %{QUERY_STRING} ^(.*)$
  30. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
  31. #主题分类与分类信息伪静态
  32. RewriteCond %{QUERY_STRING} ^(.*)$
  33. RewriteRule ^type-(\w+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&typeid=$2&typeid=$2&filter=typeid&page=$3&%1
  34. RewriteCond %{QUERY_STRING} ^(.*)$
  35. RewriteRule ^sort-(\w+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&sortid=$2&sortid=$2&filter=sortid&page=$3&%1
  36. #插件伪静态
  37. RewriteCond %{QUERY_STRING} ^(.*)$
  38. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1
  39. </IfModule>
复制代码


以上由随县论坛Www.sxbbs.cn)提供!(转帖请注明出处!)
发表于 2013-12-21 09:36:46 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

快速入职
隐私保护
薪资透明
信息可靠
手机找工作

快速回复 返回顶部 返回列表