[使用技巧] WHMCS的Nginx伪静态规则
该教程适用于whmcs 8.10.1location ~ /clients/admin/(client!\.php|client/(.*)|table/(.*)|search!\.php|search/(.*)|apps|billing|setup|user|services|addons|domains|utilitiesemailmarketer!\.php|utilities/(.*)|logs|help!\.php|help/license|modules|image/(recent|upload)|validation_com/(.*))/?(.*)$ {
rewrite ^/(.*)$ /clients/admin/index.php?rp=/admin/$1/$2;
}
location ~ /clients/(images/em|invoice|login|password|account|store|download|knowledgebase|announcements|clientarea/ssl-certificates|user/(verification|accounts|profile|password|security|verify)|cart/(domain/renew)|domain/pricing|cart/order|images/kb)/?(.*)$ {
rewrite ^/(.*)$ /clients/index.php?rp=/$1/$2;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#WHMCS 防扒皮
location ~* \.(tpl|inc|cfg)$ {
deny all;
} 不错的教程!顶起来! 群友提供了个通用版,比我写的好多了
location / {
index index.php;
try_files $uri $uri/ @whmcs;
}
location @whmcs {
rewrite ^/(.*)$ /index.php?_url=/$1 last;
}
页:
[1]