Remove parameters within nginx rewrite

Had a similar problem, after a lot of searching the answer presented itself in the rewrite docs.

If you specify a ? at the end of a rewrite then Nginx will drop the original $args (arguments)

So for your example, this would do the trick:

location ^~ /mypage.php {
    rewrite ^/mypage.php$ http://www.example.com/mypage? permanent;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)