swapidc与whmcs伪静态防止tpl模板文件下载

avatar 2019年4月19日16:44:18 评论 1,806

前言

上篇文章说了swapidc可以直接下载tpl模板文件,同样whmcs也可以,接下来我就放出伪静态防止tpl模板文件下载。

swapidc与whmcs伪静态防止tpl模板文件下载

正文

Whmcs For Apache 伪静态 文件.htaccess

RewriteEngineOn
# 公告伪静态
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
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
<Files~“\.(tpl|inc|cfg)$”>
order deny,allow
deny from all
</files>

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 ~* \.(tpl|inc|cfg)$ {
deny all;}

swapidc For Apache 伪静态 文件.htaccess

<Files~“\.(tpl|inc|cfg)$”>
order deny,allow
deny from all
</files>

swapidc For Nginx 伪静态

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

总结

作用也就是防止tpl模板下载,你们可以自己更改,有问题评论出来,我会一个一个看的。

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
广告也精彩
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: