我phpcms v9网站主机是华夏名网的,服务器是nginx1.2.1的,我在自定义伪静态里面写的伪静态规则是
rewrite ^tag/(.*) index.php?m=content&c=tag&a=lists&tag=$1 last;
但是不起作用。问客服,连伪静态的概念都没弄清楚。

经过一番摸索,正确的nginx下的伪静态规则写法是:
代码如下 |
复制代码 |
rewrite ^/tag/(.*)$ /index.php?m=content&c=tag&a=lists&tag=$1 last;
|
上部份来自小谈博客后现再详细把其它页面的都加上
代码如下 |
复制代码 |
location / {
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+).html$ $1/show.php?itemid=$2&page=$3; 效果 show-12-120-1.html show-栏目id-文章id-页数.html
rewrite ^(.*)list-([0-9]+)-([0-9]+).html$ $1/list.php?catid=$2&page=$3; 效果 content-12-120-1.html content-栏目id-文章id-页数.html
rewrite ^(.*)show-([0-9]+).html$ $1/show.php?specialid=$2;
rewrite ^/tag-([^.]*)-([0-9]+)-([0-9]+).html /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3;
rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3;
rewrite ^/([^.]*).html /index.php?m=member&c=index&a=$1;
|
一教程小编提示您,当然我们还可以使用.htaccess来实现哦。