301 Redirect Domain


#1

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.


#2

On Tue, May 26, 2009 at 3:30 AM, Chris W. removed_email_address@domain.invalid
wrote:

something like this?

server {
listen <ipaddress/port>;
server_name oldadress.com;
rewrite ^(.*)$ http://newaddress.com$1 permanent;
}


#3

Chris W. 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


#4

Thanks guys, that worked!