3
rewrite ^/index\.asp /index.php last;
rewrite ^/index\.asp\?boardid=([0-9]+)$ /forum-$1-1.html last;
rewrite ^/index\.asp\?boardid=([0-9]+)(.*)$ /forum-$1-1.html last;
rewrite ^/index_([0-9]+)(.*)$ /forum-$1-1.html last;
rewrite ^/dispbbs\.asp\?boardID=([0-9]+)&ID=([0-9]+)$ /thread-$2-1-1.html last;
我已经尝试了上面的重写规则,并得到一个死的结果,不工作。 我参考了很多文章和文章,并没有帮助。nginx重写规则不起作用?
有什么错误吗?
V/R, 加文
感谢您的答复。 :)
我已经改变了我的nginx的配置于
rewrite ^/index\.asp$ /index.php last;
rewrite ^/index\.asp\?boardid=([0-9]+)(.*)$ /forum-$1-1.html last;
rewrite ^/index\.asp\?boardid=([0-9]+)$ /forum-$1-1.html last;
rewrite ^/dispbbs\.asp\?boardID=([0-9]+)&ID=([0-9]+)$ /thread-$2-1-1.html last;
仍然没有工作。但我在规则中找不到任何错误。
谢谢。但是,我在nginx.config中也有像
rewrite ^/dispbbs_([0-9]+)_([0-9]+)\.html$ /thread-$2-1-1.html last;
这样的规则,它们工作得很完美。我会尝试你的分段。 :) – WisdomFusion 2010-03-29 08:27:07rewrite ^/dispbbs_([0-9]+)_([0-9]+)\.html$ /thread-$2-1-1.html last;
– WisdomFusion 2010-03-29 08:56:46参数(查询字符串)后问问字符。之前您可以匹配任何内容,因为它是一个字符串,但不能对查询字符串进行匹配。 – 2010-03-29 09:31:39