Redirect NGINX HTTPS domain to new HTTPS domain


#1

hello guys i want to 301 old domain on 1 server to new domain on my new server. Both domain have ssl enabled. So what are the steps that need to be followed for successful redirection. Tried everything but nothing seems to work. thanks


#2

Are both servers using easyengine (and therefore nginx)?

Are you comfortable editing nginx .conf files?

How do you want the redirection to work, e.g. just old homepage to new homepage, all old URLs to new homepage or all old URLs to new domain URLs (i.e. old.com/oldpage > new.com/oldpage)?


#3

Yes both servers are using easyengine. I can edit nginx conf files. I wish to get old.com/oldpage to new.com/oldpage


#4

OK, then it should be sufficient to just add this to the main conf for the old domain:-

return 301 https://new.com$request_uri;

And reload nginx config.


#5