淘主机 发表于 2012-12-15 11:53:10

whmcs在Nginx服务器下的伪静态规则写法

whmcs的授权比较贵,所以在自己服务器上用whmcs的朋友估计也都用Apache了,那这个文章对你就没有意义了。

但醒醒在nginx的vps上安装破解版whmcs用于测试学习,可能也有朋友跟我一样在nginx下用,就会碰到伪静态的问题,默认whmcs只提供了apache的伪静态,所以在nginx下用就需要自己写伪静态了。
代码如下:
# Announcements
rewrite ^/announcements/(+)/+.html$ /announcements.php?id=$1 last;
rewrite ^/announcements$ /announcements.php last;

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

# Knowledgebase
rewrite ^/knowledgebase/(+)/+.html$ /knowledgebase.php?action=displayarticle&id=$1 last;
rewrite ^/knowledgebase/(+)/([^/]*)$ /knowledgebase.php?action=displaycat&catid=$1 last;
rewrite ^/knowledgebase$ /knowledgebase.php last;你可别跟我说你不知道上面的nginx伪静态代码你不知道加到哪里……

淘主机 发表于 2012-12-15 11:59:18

WHMCS的htaccess规则 apache

apache下的规则,请确保放到网站根目录下的htaccess.txt修改为 .htaccessRewriteEngine On

# Announcements
RewriteRule ^announcements/(+)/+\.html$ ./announcements.php?id=$1
RewriteRule ^announcements$ ./announcements.php

# Downloads
RewriteRule ^downloads/(+)/([^/]*)$ ./downloads.php?action=displaycat&catid=$1
RewriteRule ^downloads$ ./downloads.php

# Knowledgebase
RewriteRule ^knowledgebase/(+)/+\.html$ ./knowledgebase.php?action=displayarticle&id=$1
RewriteRule ^knowledgebase/(+)/([^/]*)$ ./knowledgebase.php?action=displaycat&catid=$1
RewriteRule ^knowledgebase$ ./knowledgebase.php
页: [1]
查看完整版本: whmcs在Nginx服务器下的伪静态规则写法