欢迎光临
我们一直在努力

Whmcs下Apache和 Nginx伪静态规则和防模板下载规则

Whmcs下Apache和 Nginx伪静态规则和防模板下载规则

大部分人安装使用了鳄鱼的WHMCS主机是apache驱动,所以默认whmcs安装包里已经存在了伪静态规则,但是鳄鱼主机没有关闭目录浏览所以会暴露没有index.*文件的目录,同时这几天有几位客户也咨询了nginx的伪静态,这里也就分享下

Whmcs For Apache 伪静态 文件.htaccess
  1. RewriteEngineOn
  2. # 公告伪静态
  3. RewriteRule^announcements/([09]+)/[az09_-]+\.html$ ./announcements.php?id=$1 [L,NC]
  4. RewriteRule^announcements$ ./announcements.php [L,NC]
  5. # 下载伪静态
  6. RewriteRule^downloads/([09]+)/([^/]*)./downloads.php?action=displaycat&catid=$1 [L,NC]
  7. RewriteRule^downloads$ ./downloads.php [L,NC]
  8. # 知识库伪静态
  9. RewriteRule^knowledgebase/([09]+)/[az09_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC]
  10. RewriteRule^knowledgebase/([09]+)/([^/]*)./knowledgebase.php?action=displaycat&catid=$1 [L,NC]
  11. RewriteRule^knowledgebase$ ./knowledgebase.php [L,NC]
  12. # 防止目录暴露禁止TPL INC CFG文件被下载
  13. OptionsIndexes
  14. <Limit GET POST>
  15. order deny,allow
  16. deny from all
  17. allow from all
  18. </Limit>
  19. <Limit PUT DELETE>
  20. order deny,allow
  21. deny from all
  22. </Limit>
  23. <Files~“\.(tpl|inc|cfg)$”>
  24. order deny,allow
  25. deny from all
  26. </files>
Whmcs For Nginx 伪静态
  1. # 公告伪静态
  2. rewrite ^/announcements/([09]+)/[az09_-]+.html$ /./announcements.php?id=$1 last;
  3. rewrite ^/announcements$ /./announcements.php last;
  4. # 下载伪静态
  5. rewrite ^/downloads/([09]+)/([^/]*)/./downloads.php?action=displaycat&catid=$1 last;
  6. rewrite ^/downloads$ /./downloads.php last;
  7. # 知识库伪静态
  8. rewrite ^/knowledgebase/([09]+)/[az09_-]+.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
  9. rewrite ^/knowledgebase/([09]+)/([^/]*)/./knowledgebase.php?action=displaycat&catid=$1 last;
  10. rewrite ^/knowledgebase$ /./knowledgebase.php last;
  11. # 防止tpl inc cfg文件被下载
  12. location ~* \.(tpl|inc|cfg){
  13. deny all;}
赞(0) 打赏
未经允许不得转载:顶好爱迪 » Whmcs下Apache和 Nginx伪静态规则和防模板下载规则
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

顶好爱迪 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏