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

Status
Not open for further replies.

bachbell

Active Member
689
2009
116
0
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:
2 comments
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
 
Status
Not open for further replies.
Back
Top