2014-07-09 94 views
0

我使用這個重寫規則重定向http://example.com/a-b-c?id=learn-more重寫URL nginx的刪除連字符

http://example.com/abc?id=learnmore

rewrite ^/a-b-c?id=learn-More http://example.com/abc?id=learnMore permanent 

但它不工作!它重定向到

http://example.com/abc?id=learn-more(LEARNMORE不轉換爲LEARNMORE)。

如何實現這一目標?

+0

'rewrite'不帶參數的工作。 –

+0

嘗試描述整個問題 –

+0

我在 http://example.com/abc?id=learnMore 有一個頁面,但我想,當用戶訪問 http://example.com/abc?id=learn - 更多(搜索引擎優化產生的),他將被重定向到 http://example.com/abc?id=learnMore(正如你看到的連字符被刪除) – user3382916

回答

0
location = /a-b-c { 
    if ($arg_id = learn-More) { 
     return 301 /abc?id=learnMore; 
    } 
}