WHMCS自学教程,Nginx伪静态规则,Apache伪静态规则,宝塔面板可直接使用,WHMCS Study


Nginx伪静态规则

# Announcements
rewrite ^/announcements/([0-9]+)/[a-zA-Z0-9_-]+.html$ /announcements.php?id=$1 last;
rewrite ^/announcements$ /announcements.php last;

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

# Knowledgebase
rewrite ^/knowledgebase/([0-9]+)/[a-zA-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;

若已安装宝塔面板,直接放到伪静态里面即可

WHMCS自学教程,Nginx伪静态规则,Apache伪静态规则,宝塔面板可直接使用,WHMCS Study

Apache伪静态规则

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
<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>

若已安装宝塔面板,直接放到伪静态里面即可

 

给TA打赏
共{{data.count}}人
人已打赏
优惠服务器

hostEONS服务商/5月优惠促销/美国不限流量VPS终身5折起/最低9.6美元每年

2024-7-26 14:38:30

优惠服务器

微信小程序 服务器

2024-7-26 14:38:33

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索