I'm trying to redirect all traffic from my www.old-domain.com
to www.new-domain.com
, while keeping all path and query parameters in the url, and append a new query parameter such as &from-old=true
.
For example
www.old-domain.com --> www.new-domain.com/?from-old=true
www.old-domain.com/home --> www.new-domain.com/home?from-old=true
www.old-domain.com/item?id=123 --> www.new-domain.com/item?id=123&from-old=true
Please share some thoughts about how I should rewrite/return the url in Nginx to achieve this.
Thanks in advance!