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