Welcome! Log In Create A New Profile

Advanced

Re: 301 Redirect Domain

May 25, 2009 04:45PM
Chris Wilson wrote:
> Is there a way to redirect and old domain to a new one,
>
> For instance, all I did was change domains, the structure is all still
> the same.
>
> I just need to redirect xxxx.com to xxxy.com while still keeping the
> structure of the incoming links as they remain in the same pace on the
> new site.
>

server {

listen 80;

server_name xxxx.com www.xxxx.com;

...

rewrite ^ http://yyyy.com$request_uri? permanent;

}

should do it.



If you want to get fancy you can separate out like:

server {

listen 80;

server_name xxxx.com;

...

rewrite ^ http://yyyy.com$request_uri? permanent;

}

server {

listen 80;

server_name www.xxxx.com;

...

rewrite ^ http://www.yyyy.com$request_uri? permanent;

}

Jim
Subject Author Posted

301 Redirect Domain

Chris Wilson May 25, 2009 04:30PM

Re: 301 Redirect Domain

Jim Ohlstein May 25, 2009 04:45PM

Re: 301 Redirect Domain

Chris Wilson May 25, 2009 05:32PM

Re: 301 Redirect Domain

edogawaconan May 25, 2009 04:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 255
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready