lnmp WHMCS 伪静态规则的写法rewrite rule

WHMCS官方只提供了apache伪静态规则,对于nginx爱好者来说,只好自己琢磨了。

Nginx WHMCS伪静态规则如下:

  1. # 公告伪静态
  2. rewrite ^/announcements/([0–9]+)/[a-z0-9_-]+.html$ /./announcements.php?id=$1 last;
  3. rewrite ^/announcements$ /./announcements.php last;
  4. # 下载伪静态
  5. rewrite ^/downloads/([0–9]+)/([^/]*)$ /./downloads.php?action=displaycat&catid=$1 last;
  6. rewrite ^/downloads$ /./downloads.php last;
  7. # 知识库伪静态
  8. rewrite ^/knowledgebase/([0–9]+)/[a-z0-9_-]+.html$ /./knowledgebase.php?action=displayarticle&id=$1 last;
  9. rewrite ^/knowledgebase/([0–9]+)/([^/]*)$ /./knowledgebase.php?action=displaycat&catid=$1 last;
  10. rewrite ^/knowledgebase$ /./knowledgebase.php last;
  11. # 防止tpl inc cfg文件被下载
  12. location ~* \.(tpl|inc|cfg)$ {
  13. deny  all; }


本站提供的服务

  • wordpress主题、插件、开发、优化以及WordPress虚拟主机、VPS售卖
  • 自用Shadowsocks 服务器搭建 RMB50/次
  • VPN(PPTP&L2TP)流量出售: 5RMB/GB,10GB起售,8条台湾、美国、香港线路
    • 联系QQ:2564692806

      打赏作者
      这篇文章帮助很大,重重有赏

      您的支持将鼓励我们继续创作!

      [微信] 扫描二维码打赏

      [支付宝] 扫描二维码打赏

      正在跳转到PayPal...

female geek, creator of sscloud. keyword: php, html5+css3, python, wordpress

Leave a reply:

Your email address will not be published.

Site Footer