Welcome! Log In Create A New Profile

Advanced

Re: Rewriting request to www.domain.com to domain.com

António P. P. Almeida
January 31, 2011 09:10AM
On 31 Jan 2011 13h11 WET, appa@perusio.net wrote:

> On 31 Jan 2011 10h53 WET, zblut@cerego.com wrote:
>
> Your rewrite doesn't work because you're not passing along the
> request URI available in the $request_uri variable.
>
> Use 2 server blocks:
>
server {
## This is to avoid the spurious if for sub-domain name
## rewriting. See http://wiki.nginx.org/Pitfalls#Server_Name.
listen 80;

server_name www.foobar.com;
rewrite ^ $scheme://foobar.com permanent;
} # server domain rewrite.

I've read incorrectly what you want to do. You just want to
redirect all www.foobar.com requests to the root foobar.com. Then the
above works.

--- appa


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewriting request to www.domain.com to domain.com

Zev Blut January 31, 2011 06:02AM

Re: Rewriting request to www.domain.com to domain.com

António P. P. Almeida January 31, 2011 08:20AM

Re: Rewriting request to www.domain.com to domain.com

António P. P. Almeida January 31, 2011 09:10AM

Re: Rewriting request to www.domain.com to domain.com

Igor Sysoev January 31, 2011 08:52AM

Re: Rewriting request to www.domain.com to domain.com

Zev Blut January 31, 2011 09:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 235
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