主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情! |
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作 |
安装使用了鳄鱼的WHMCS主机是apache驱动,所以默认whmcs安装包里已经存在了伪静态规则,但是鳄鱼主机没有关闭目录浏览所以会暴露没有index.*文件的目录
Whmcs For Apache 伪静态 文件.htaccess:
# 公告伪静态
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=displaycatcatid=$1 [L,NC]
RewriteRule ^downloads$ ./downloads.php [L,NC]
# 知识库伪静态
RewriteRule ^knowledgebase/([0-9]+)/[a-z0-9_-]+\.html$ ./knowledgebase.php?action=displayarticleid=$1 [L,NC]
RewriteRule ^knowledgebase/([0-9]+)/([^/]*)$ ./knowledgebase.php?action=displaycatcatid=$1 [L,NC]
RewriteRule ^knowledgebase$ ./knowledgebase.php [L,NC]
# 防止目录暴露禁止TPL INC CFG文件被下载
Options -Indexes
order deny,allow
allow from all
order deny,allow
deny from all
order deny,allow
deny from all
# 公告伪静态
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=displaycatcatid=$1 last;
rewrite ^/downloads$ /./downloads.php last;
# 知识库伪静态
rewrite ^/knowledgebase/([0-9]+)/[a-z0-9_-]+.html$ /./knowledgebase.php?action=displayarticleid=$1 last;
rewrite ^/knowledgebase/([0-9]+)/([^/]*)$ /./knowledgebase.php?action=displaycatcatid=$1 last;
rewrite ^/knowledgebase$ /./knowledgebase.php last;
# 防止tpl inc cfg文件被下载
location ~* \.(tplinccfg)$ {
deny all; }
这几篇文章你可能也喜欢:
- Vultr官方宣布:将于2021年10月1日正式对快照备份存储进行收费,附最新详细收费标准和说明
- EdgeNat,韩国原生IP VPS云服务器新上线,全场VPS八折优惠,香港CN2/洛杉矶CN2 GIA,KVM虚拟架构,1核心1G内存2Mbps带宽不限流量,80元/月
- ZABBIX监视VMware exsi主机的步骤
- nginx服务器究竟是如何执行PHP项目的
- ZABBIX 4.04安装文档教程详细信息(基于CentOS 7.6)
本文由主机参考刊发,转载请注明:WHMCS,Apache和Nginx伪静态规则和防模板下载规则 https://zhujicankao.com/3014.html
WHMCS,Apache和Nginx伪静态规则和防模板下载规则