2014-07-09 95 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; 
    } 
}