VPS参考测评推荐
专注分享VPS主机优惠信息

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

etkvm
主机参考:VPS主机测评推荐网,专注分享VPS主机优惠信息!如果您想在本站投放您的广告,点此直达!如果您不想付费,您也可以免费投稿您的产品信息,点此直达联系我们
部分文章发布时间较久远,可能存在未知因素,购买时建议在本博客搜索商家名称,可查看相关文章充分了解商家!若非中文页面可使用谷歌浏览器同步翻译!诚信商家&星级推荐

安装使用了鳄鱼的WHMCS主机是apache驱动,所以默认whmcs安装包里已经存在了伪静态规则,但是鳄鱼主机没有关闭目录浏览所以会暴露没有index.*文件的目录

Whmcs For Apache 伪静态 文件.htaccess:

RewriteEngine On

 

# 公告伪静态

RewriteRule ^announcements/([0-9]+)/[a-z0-9_-]+\.html$ ./announcements.php?id=$1 [L,NC]

RewriteRule ^announcements$ ./announcements.php [L,NC]

 

# 下载伪静态

RewriteRule ^downloads/([0-9]+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1 [L,NC]

RewriteRule ^downloads$ ./downloads.php [L,NC]

 

# 知识库伪静态

RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticle&id=$1 [L,NC]

RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1 [L,NC]

RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC]

 

# 防止目录暴露禁止TPL INC CFG文件被下载

Options -Indexes

order deny,allow

deny from all

allow from all

order deny,allow

deny from all

order deny,allow

deny from all

 

Whmcs For Nginx 伪静态:

# 公告伪静态
rewrite ^/announcements/([0-9]+)/[a-z0-9_-]+.html$ /./announcements.php?id=$1 last;
rewrite ^/announcements$ /./announcements.php last;

# 下载伪静态
rewrite ^/downloads/([0-9]+)/([^/]*)$ /./downloads.php?action=displaycat&catid=$1 last;
rewrite ^/downloads$ /./downloads.php last;

# 知识库伪静态
rewrite ^/knowledgebase/([0-9]+)/[a-z0-9_-]+.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
rewrite ^/knowledgebase/([0-9]+)/([^/]*)$ /./knowledgebase.php?action=displaycat&catid=$1 last;
rewrite ^/knowledgebase$ /./knowledgebase.php last;

# 防止tpl inc cfg文件被下载
location ~* \.(tplinccfg)$ {
deny all; }

vpsor
打赏
转载请注明原文链接:主机参考 » WHMCS,Apache和Nginx伪静态规则和防模板下载规则
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!

相关推荐


评论 1

  1. #1

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

    主机参考 3个月前 (08-31)回复

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

支付宝扫一扫打赏

微信扫一扫打赏