0

I am trying to redirect a url from one domain to another domain in nginx.

URL 1 - http://domain1/event/ert123

URL 2 - http://domain2/event/dfe456

I have used the following code but doesn't work.

 #Test event location /event/ert123 { return 301 http://domain2.com/$request_uri } 

Any help is highly appreciated. Thanks in advance.

1
  • What doesn't work? Commented Mar 7, 2018 at 15:13

1 Answer 1

1

Why $request_uri? Maybe something like this?

 location /event/ert123 { return 301 http://domain2.com/event/dfe456 } 
Sign up to request clarification or add additional context in comments.

1 Comment

Worked Thanks a lot.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.