BluRayCD Forum

 找回密码
 立即注册【分享大片】
查看: 460|回复: 0
收起左侧

[空间技术] DZX1.5论坛htaccess伪静态+绑子目录+404 防盗链设置

[复制链接]

410

主题

177

回帖

1万

积分

Forum CEO

金币
2568 枚
体力
11797 点
kmxmxy 发表于 2011-5-12 15:03:12 | 显示全部楼层 |阅读模式
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /
# Rewrite 系统规则请勿修改

本附件中只包含为静态
其他的防盗链等自己看看研究吧 很简单的
404错误页如果服务器控制面板没有在这里也可以
可以绑子目录 测试都OK 但是不是那么太好用!但好的是都可以实现!

  1. 将 RewriteEngine 模式打开
  2. RewriteEngine On

  3. 伪静态规则DZX

  4. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1
  5. RewriteRule ^article-([0-9]+)\.html$ portal.php?mod=article&articleid=$1
  6. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2
  7. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2
  8. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2
  9. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2
  10. RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2

  11. 指定404、500错误页

  12. RewriteEngine On
  13. #RewriteBase /
  14. ErrorDocument 404 /404.html
  15. ErrorDocument 500 /500.html

  16. 防盗链:

  17. RewriteCond %{HTTP_REFERER} !https://vonephoto.com/.*$ [NC]
  18. RewriteCond %{HTTP_REFERER} !https://vonephoto.com$ [NC]
  19. RewriteCond %{HTTP_REFERER} !https://vonephoto.net/.*$ [NC]
  20. RewriteCond %{HTTP_REFERER} !https://vonephoto.net$ [NC]
  21. RewriteCond %{HTTP_REFERER} !https://www.vonephoto.com/.*$ [NC]
  22. RewriteCond %{HTTP_REFERER} !https://www.vonephoto.com$ [NC]
  23. RewriteCond %{HTTP_REFERER} !https://www.vonephoto.net/.*$ [NC]
  24. RewriteCond %{HTTP_REFERER} !https://www.vonephoto.net$ [NC]
  25. RewriteRule .(mp3|wma|jpg|gif|png|bmp|swf|jpeg) /images/daolian.gif [R,NC,L]

  26. 二级域名绑定到子目录:

  27. RewriteCond %{HTTP_HOST} ^www.vonephoto.com$
  28. RewriteCond %{REQUEST_URI} !^/index/
  29. RewriteCond %{REQUEST_FILENAME} !-f
  30. RewriteCond %{REQUEST_FILENAME} !-d
  31. RewriteRule ^(.*)$ /index/$1
  32. RewriteCond %{HTTP_HOST} ^www.vonephoto.com$
  33. RewriteRule ^(/)?$ index/index.htm [L]
复制代码


您知道吗,申请VIP会员可以免回复下载,无广告骚扰, 点此处申请

本版积分规则

小黑屋|手机版|Archiver|4K蓝光论坛

GMT+8, 2024-4-29 03:11

Copyright © 2001-2021, Gadaddy Cloud.

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