Why is www.domain.com not redirecting to domain.com?Nginx has ssl module, but thinks it doesn'tCan not change nginx 1.2.5 default websitenginx ssl proxy for one hostname onlyNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?Nginx reverse proxy to many local servers + webserver duty

Why was this character made Grand Maester?

Python script to extract text from PDF with images

Did Game of Thrones end the way that George RR Martin intended?

Was this scene in S8E06 added because of fan reactions to S8E04?

Using too much dialogue?

Is superuser the same as root?

Fill area of x^2+y^2>1 and x^2+y^2>4 using patterns and tikzpicture

Toxic, harassing lab environment

How does the Earth's center produce heat?

How do you earn the reader's trust?

Why do the i8080 I/O instructions take a byte-sized operand to determine the port?

How did the Allies achieve air superiority on Sicily?

Piping the output of comand columns

Flatten not working

Could a rotating ring space station have a bolo-like extension?

Moons and messages

Cisco 3750X Power Cable

Why is the Eisenstein ideal paper so great?

Is it safe to redirect stdout and stderr to the same file without file descriptor copies?

Status of proof by contradiction and excluded middle throughout the history of mathematics?

Why is 'additive' EQ more difficult to use than 'subtractive'?

What is the purpose of the yellow wired panels on the IBM 360 Model 20?

Are runways booked by airlines to land their planes?

EU rights when flight delayed so much that return is missed



Why is www.domain.com not redirecting to domain.com?


Nginx has ssl module, but thinks it doesn'tCan not change nginx 1.2.5 default websitenginx ssl proxy for one hostname onlyNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?Nginx reverse proxy to many local servers + webserver duty






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I want www.lizardgizzards.com to redirect to https://lizardgizzards.com



But instead it redirects to https://www.lizardgizzards.com



Here's my redirect config:



server 
listen 80;
listen [::]:80;

server_name lizardgizzards.com www.lizardgizzards.com;

if ($host = 'www.lizardgizzards.com')
return 301 https://lizardgizzards.com;


if ($host = 'lizardgizzards.com')
return 301 https://$host$request_uri;




my SSL config:



server 
root /var/www/html/lizardgizzards.com;

index index.html index.htm index.nginx-debian.html;

server_name lizardgizzards.com;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;


listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
listen 443 ssl default_server; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



It seems to be working with the dig command:



ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 09 May 2019 03:52:45 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: http://lizardgizzards.com


But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com










share|improve this question




























    0















    I want www.lizardgizzards.com to redirect to https://lizardgizzards.com



    But instead it redirects to https://www.lizardgizzards.com



    Here's my redirect config:



    server 
    listen 80;
    listen [::]:80;

    server_name lizardgizzards.com www.lizardgizzards.com;

    if ($host = 'www.lizardgizzards.com')
    return 301 https://lizardgizzards.com;


    if ($host = 'lizardgizzards.com')
    return 301 https://$host$request_uri;




    my SSL config:



    server 
    root /var/www/html/lizardgizzards.com;

    index index.html index.htm index.nginx-debian.html;

    server_name lizardgizzards.com;

    location /
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;


    listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
    listen 443 ssl default_server; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



    It seems to be working with the dig command:



    ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
    HTTP/1.1 301 Moved Permanently
    Server: nginx/1.14.0 (Ubuntu)
    Date: Thu, 09 May 2019 03:52:45 GMT
    Content-Type: text/html
    Content-Length: 194
    Connection: keep-alive
    Location: http://lizardgizzards.com


    But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com










    share|improve this question
























      0












      0








      0








      I want www.lizardgizzards.com to redirect to https://lizardgizzards.com



      But instead it redirects to https://www.lizardgizzards.com



      Here's my redirect config:



      server 
      listen 80;
      listen [::]:80;

      server_name lizardgizzards.com www.lizardgizzards.com;

      if ($host = 'www.lizardgizzards.com')
      return 301 https://lizardgizzards.com;


      if ($host = 'lizardgizzards.com')
      return 301 https://$host$request_uri;




      my SSL config:



      server 
      root /var/www/html/lizardgizzards.com;

      index index.html index.htm index.nginx-debian.html;

      server_name lizardgizzards.com;

      location /
      # First attempt to serve request as file, then
      # as directory, then fall back to displaying a 404.
      try_files $uri $uri/ =404;


      listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
      listen 443 ssl default_server; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



      It seems to be working with the dig command:



      ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
      HTTP/1.1 301 Moved Permanently
      Server: nginx/1.14.0 (Ubuntu)
      Date: Thu, 09 May 2019 03:52:45 GMT
      Content-Type: text/html
      Content-Length: 194
      Connection: keep-alive
      Location: http://lizardgizzards.com


      But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com










      share|improve this question














      I want www.lizardgizzards.com to redirect to https://lizardgizzards.com



      But instead it redirects to https://www.lizardgizzards.com



      Here's my redirect config:



      server 
      listen 80;
      listen [::]:80;

      server_name lizardgizzards.com www.lizardgizzards.com;

      if ($host = 'www.lizardgizzards.com')
      return 301 https://lizardgizzards.com;


      if ($host = 'lizardgizzards.com')
      return 301 https://$host$request_uri;




      my SSL config:



      server 
      root /var/www/html/lizardgizzards.com;

      index index.html index.htm index.nginx-debian.html;

      server_name lizardgizzards.com;

      location /
      # First attempt to serve request as file, then
      # as directory, then fall back to displaying a 404.
      try_files $uri $uri/ =404;


      listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
      listen 443 ssl default_server; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



      It seems to be working with the dig command:



      ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
      HTTP/1.1 301 Moved Permanently
      Server: nginx/1.14.0 (Ubuntu)
      Date: Thu, 09 May 2019 03:52:45 GMT
      Content-Type: text/html
      Content-Length: 194
      Connection: keep-alive
      Location: http://lizardgizzards.com


      But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com







      nginx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 9 at 3:50









      Blaine LafreniereBlaine Lafreniere

      18029




      18029




















          2 Answers
          2






          active

          oldest

          votes


















          0














          So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...



          In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.






          share|improve this answer























          • you don't have any redirects configured in your ssl configuration.

            – Gerald Schneider
            May 9 at 6:53


















          0














          Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.



          Start browsing your desired URL again and watch the things your browser is doing.



          I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.



          Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966489%2fwhy-is-www-domain-com-not-redirecting-to-domain-com%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...



            In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.






            share|improve this answer























            • you don't have any redirects configured in your ssl configuration.

              – Gerald Schneider
              May 9 at 6:53















            0














            So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...



            In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.






            share|improve this answer























            • you don't have any redirects configured in your ssl configuration.

              – Gerald Schneider
              May 9 at 6:53













            0












            0








            0







            So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...



            In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.






            share|improve this answer













            So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...



            In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 9 at 3:59









            Blaine LafreniereBlaine Lafreniere

            18029




            18029












            • you don't have any redirects configured in your ssl configuration.

              – Gerald Schneider
              May 9 at 6:53

















            • you don't have any redirects configured in your ssl configuration.

              – Gerald Schneider
              May 9 at 6:53
















            you don't have any redirects configured in your ssl configuration.

            – Gerald Schneider
            May 9 at 6:53





            you don't have any redirects configured in your ssl configuration.

            – Gerald Schneider
            May 9 at 6:53













            0














            Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.



            Start browsing your desired URL again and watch the things your browser is doing.



            I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.



            Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.






            share|improve this answer



























              0














              Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.



              Start browsing your desired URL again and watch the things your browser is doing.



              I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.



              Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.






              share|improve this answer

























                0












                0








                0







                Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.



                Start browsing your desired URL again and watch the things your browser is doing.



                I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.



                Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.






                share|improve this answer













                Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.



                Start browsing your desired URL again and watch the things your browser is doing.



                I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.



                Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 11 at 15:45









                Jens BradlerJens Bradler

                3,87121313




                3,87121313



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966489%2fwhy-is-www-domain-com-not-redirecting-to-domain-com%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                    What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                    Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?