how to redirect old domain to new domain in nginx? but...

avengr

New Member
how to redirect a old domain to a new one in nginx .. but i want to be redirected to main url only mysite.com the old domain was using a script totally diferent so i dont need to keep urls like oldsite.com/blog to newsite.com/blog.. i just want all the traffic that still sends google or organic traffic redirects to main url no matter if they type oldsite/blog olsite/gallery etc


thanks Last edited by bachbell; 29th Oct 2012 at 07:33 AM. in your oldsite.com.conf file add

Code: server { server_name www.oldsite.com; rewrite ^ http://www.newsite.com permanent;}after updating restart nginx

Code: service nginx restart thank you :)
 
Top