0

using nginx( version >1 ) rewrite I would like to rewrite

www.domain.com/local/airports/jfk-2/ as www.domain.com/local/airports/jfk/

There are too many locations like above.

I tried below without luck rewrite ^/local/airports/(.*)/ /local/airports/$1-2/ permanent;

What is the best way to get this work? Thanks

4

1 回答 1

0

好的,这有点太具体了,但据我了解,您不需要任何其他东西

location /local/airports/(.*)-2 {
    return 301 http://example.com/local/airports/$1;
}
于 2013-08-24T20:21:46.430 回答