Skip to content
WJunction - Webmaster Forum

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

Status
Not open for further replies.
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.

About the author

B
Active Member · Joined
689
Messages
116
Reactions
43
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom