VPS联盟
我们一直在努力
cloudacead cloudacead cloudacead

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>

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

 

赞(0)
未经允许不得转载:VPS联盟 » WHMCS自学教程,Nginx伪静态规则,Apache伪静态规则,宝塔面板可直接使用,WHMCS Study
分享到: 更多 (0)