problem with redirect domain.tld => www.domain.tld with NGINX

Discussion in 'Installation/Configuration' started by sidbyron, Aug 10, 2014.

  1. sidbyron

    sidbyron Member

    problem with redirect domain.tld => www.domain.tld with NGINX

    Hi,

    I have problem with this directive because I have 3 domains on my server and when I use the SEO redirection all the pages were redirected to the first domain.

    When I se de vhost I see this command:

    if ($http_host = "domain.tld") {
    rewrite ^ $scheme://www.domain.tld$request_uri? permanent;
    }

    I change it to:

    if ($http_host ~* "^domain.tld$") {
    rewrite ^ $scheme://www.domain.tld$request_uri? permanent;
    }

    I tested and the redirection works fine. Please fix it.

    Kind Regards.


    Bug Tracking FS#3612 and I followed this tuto: http://www.howtoforge.com/perfect-server-debian-wheezy-nginx-bind-dovecot-ispconfig-3
     

Share This Page