0

I am pretty new to Nginx and I was wondering how to do a rewrite. I migrated an old site to a new site and google still has my old ip saved and is returning it in many google search results. I would like to redirect traffic from old to new site with the full URL, and I tried the following.

rewrite ^ http://mysite.com/ permanent;

However, this is mapping http://myoldsite.com/my_controller/my_action/:id?some_get_param=foo&another_get_param=bar

TO

http://mysite.com?some_get_param=foo&another_get_param=bar

How can I make this redirect include my controller and action parameters ( Everything after the base url ) ?

1 Answer 1

1

The request_uri is being stripped during the rewrite. See http://wiki.nginx.org/HttpRewriteModule#rewrite

rewrite ^ http://mysite.com$request_uri? permanent; 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.