Welcome! Log In Create A New Profile

Advanced

Re: Redirect www to no-www with variable (for multiple domains)?

July 08, 2013 05:47PM
Edho Arief Wrote:
-------------------------------------------------------
> On Sun, Jul 7, 2013 at 6:30 PM, lennart <nginx-forum@nginx.us> wrote:
> >
> > Is there a way to do this with regex or variables? I've ~15 domains
> and it
> > would be more convenient to have only one entry "to rule them all"
> ;-)
> >
>
> the regex way, which is supposedly slower:
>
> server {
> server_name ~^www\.(?<domain>.+)$;
> listen 80; listen [::]:80;
> return 301 $scheme://$domain$request_uri;
> }
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

'supposedly slower' is a very good argument to not use RegEx ;-) Do you have a source for that?
SubjectAuthorPosted

Redirect www to no-www with variable (for multiple domains)?

lennartJuly 07, 2013 05:30AM

Re: Redirect www to no-www with variable (for multiple domains)?

Jonathan MatthewsJuly 07, 2013 07:44AM

Re: Redirect www to no-www with variable (for multiple domains)?

lennartJuly 07, 2013 08:22AM

Re: Redirect www to no-www with variable (for multiple domains)?

Sajan ParikhJuly 07, 2013 07:48AM

Re: Redirect www to no-www with variable (for multiple domains)?

Sajan ParikhJuly 07, 2013 02:48PM

Re: Redirect www to no-www with variable (for multiple domains)?

Edho AriefJuly 08, 2013 12:50AM

Re: Redirect www to no-www with variable (for multiple domains)?

lennartJuly 08, 2013 05:47PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 165 on April 21, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready