Website not working if www is in URL [duplicate]












1















This question already has an answer here:




  • Redirecting from http to https in Apache

    2 answers




I am forcing my webserver to rewrite a none www URL to www, e.g. https://example.com to https://www.example.com, via .htaccess.



RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


But my site does not load with www and prints ERR_TOO_MANY_REDIRECTS.



If I enter a URL like https://www.example.com/some-uri then I get redirected to https://example.com



DNS Zone Records
DNS Zone Record



What might be the cause?










share|improve this question















marked as duplicate by kasperd, bodgit, Gerald Schneider, Thomas, Drifter104 Dec 14 '18 at 16:00


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 1




    I was able to solve the problem. It was a magento setting. More infos
    – Black
    Dec 12 '18 at 11:28










  • Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
    – MrWhite
    Dec 12 '18 at 11:30










  • @MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    – Black
    Dec 12 '18 at 11:32






  • 1




    Write a proper answer.
    – Sven
    Dec 12 '18 at 11:35










  • Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
    – MrWhite
    Dec 12 '18 at 11:36


















1















This question already has an answer here:




  • Redirecting from http to https in Apache

    2 answers




I am forcing my webserver to rewrite a none www URL to www, e.g. https://example.com to https://www.example.com, via .htaccess.



RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


But my site does not load with www and prints ERR_TOO_MANY_REDIRECTS.



If I enter a URL like https://www.example.com/some-uri then I get redirected to https://example.com



DNS Zone Records
DNS Zone Record



What might be the cause?










share|improve this question















marked as duplicate by kasperd, bodgit, Gerald Schneider, Thomas, Drifter104 Dec 14 '18 at 16:00


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 1




    I was able to solve the problem. It was a magento setting. More infos
    – Black
    Dec 12 '18 at 11:28










  • Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
    – MrWhite
    Dec 12 '18 at 11:30










  • @MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    – Black
    Dec 12 '18 at 11:32






  • 1




    Write a proper answer.
    – Sven
    Dec 12 '18 at 11:35










  • Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
    – MrWhite
    Dec 12 '18 at 11:36
















1












1








1








This question already has an answer here:




  • Redirecting from http to https in Apache

    2 answers




I am forcing my webserver to rewrite a none www URL to www, e.g. https://example.com to https://www.example.com, via .htaccess.



RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


But my site does not load with www and prints ERR_TOO_MANY_REDIRECTS.



If I enter a URL like https://www.example.com/some-uri then I get redirected to https://example.com



DNS Zone Records
DNS Zone Record



What might be the cause?










share|improve this question
















This question already has an answer here:




  • Redirecting from http to https in Apache

    2 answers




I am forcing my webserver to rewrite a none www URL to www, e.g. https://example.com to https://www.example.com, via .htaccess.



RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


But my site does not load with www and prints ERR_TOO_MANY_REDIRECTS.



If I enter a URL like https://www.example.com/some-uri then I get redirected to https://example.com



DNS Zone Records
DNS Zone Record



What might be the cause?





This question already has an answer here:




  • Redirecting from http to https in Apache

    2 answers








web-server .htaccess dns-zone magento






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 14 '18 at 11:12









MrWhite

5,54721424




5,54721424










asked Dec 12 '18 at 11:22









Black

1439




1439




marked as duplicate by kasperd, bodgit, Gerald Schneider, Thomas, Drifter104 Dec 14 '18 at 16:00


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by kasperd, bodgit, Gerald Schneider, Thomas, Drifter104 Dec 14 '18 at 16:00


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    I was able to solve the problem. It was a magento setting. More infos
    – Black
    Dec 12 '18 at 11:28










  • Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
    – MrWhite
    Dec 12 '18 at 11:30










  • @MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    – Black
    Dec 12 '18 at 11:32






  • 1




    Write a proper answer.
    – Sven
    Dec 12 '18 at 11:35










  • Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
    – MrWhite
    Dec 12 '18 at 11:36
















  • 1




    I was able to solve the problem. It was a magento setting. More infos
    – Black
    Dec 12 '18 at 11:28










  • Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
    – MrWhite
    Dec 12 '18 at 11:30










  • @MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    – Black
    Dec 12 '18 at 11:32






  • 1




    Write a proper answer.
    – Sven
    Dec 12 '18 at 11:35










  • Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
    – MrWhite
    Dec 12 '18 at 11:36










1




1




I was able to solve the problem. It was a magento setting. More infos
– Black
Dec 12 '18 at 11:28




I was able to solve the problem. It was a magento setting. More infos
– Black
Dec 12 '18 at 11:28












Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
– MrWhite
Dec 12 '18 at 11:30




Aside: Any reason why you are not redirecting to HTTPS with your .htaccess redirect?
– MrWhite
Dec 12 '18 at 11:30












@MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
– Black
Dec 12 '18 at 11:32




@MrWhite, no, It is just dev .htaccess. I think I could just use RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] instead of RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
– Black
Dec 12 '18 at 11:32




1




1




Write a proper answer.
– Sven
Dec 12 '18 at 11:35




Write a proper answer.
– Sven
Dec 12 '18 at 11:35












Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
– MrWhite
Dec 12 '18 at 11:36






Yes, if your site is HTTPS then you should simply redirect to https://.... The directive as it stands would keep the user on HTTP - if that was requested. Unless you have something before that redirects to HTTPS? (And/or possibly result in a 2nd redirect to HTTPS later?)
– MrWhite
Dec 12 '18 at 11:36












1 Answer
1






active

oldest

votes


















3














I was able to solve the problem. It was a magento setting.



There is a setting in system->configuration->Web->Url Options->Auto-redirect to Base URL. Set that to 'No'.






share|improve this answer























  • I can accept this answer in 2 days.
    – Black
    Dec 12 '18 at 15:23






  • 1




    If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
    – Michael Hampton
    Dec 12 '18 at 17:27










  • Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
    – Black
    Dec 13 '18 at 8:28


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














I was able to solve the problem. It was a magento setting.



There is a setting in system->configuration->Web->Url Options->Auto-redirect to Base URL. Set that to 'No'.






share|improve this answer























  • I can accept this answer in 2 days.
    – Black
    Dec 12 '18 at 15:23






  • 1




    If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
    – Michael Hampton
    Dec 12 '18 at 17:27










  • Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
    – Black
    Dec 13 '18 at 8:28
















3














I was able to solve the problem. It was a magento setting.



There is a setting in system->configuration->Web->Url Options->Auto-redirect to Base URL. Set that to 'No'.






share|improve this answer























  • I can accept this answer in 2 days.
    – Black
    Dec 12 '18 at 15:23






  • 1




    If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
    – Michael Hampton
    Dec 12 '18 at 17:27










  • Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
    – Black
    Dec 13 '18 at 8:28














3












3








3






I was able to solve the problem. It was a magento setting.



There is a setting in system->configuration->Web->Url Options->Auto-redirect to Base URL. Set that to 'No'.






share|improve this answer














I was able to solve the problem. It was a magento setting.



There is a setting in system->configuration->Web->Url Options->Auto-redirect to Base URL. Set that to 'No'.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 12 '18 at 15:23

























answered Dec 12 '18 at 15:15









Black

1439




1439












  • I can accept this answer in 2 days.
    – Black
    Dec 12 '18 at 15:23






  • 1




    If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
    – Michael Hampton
    Dec 12 '18 at 17:27










  • Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
    – Black
    Dec 13 '18 at 8:28


















  • I can accept this answer in 2 days.
    – Black
    Dec 12 '18 at 15:23






  • 1




    If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
    – Michael Hampton
    Dec 12 '18 at 17:27










  • Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
    – Black
    Dec 13 '18 at 8:28
















I can accept this answer in 2 days.
– Black
Dec 12 '18 at 15:23




I can accept this answer in 2 days.
– Black
Dec 12 '18 at 15:23




1




1




If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
– Michael Hampton
Dec 12 '18 at 17:27




If that solved the problem, then the base URL is almost certainly wrong. Check it and fix it.
– Michael Hampton
Dec 12 '18 at 17:27












Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
– Black
Dec 13 '18 at 8:28




Thanks for the hint @MichaelHampton. You are right, I also had to change the Base URL in the backend (for secure and unsecure) from https://mycompany.de/ to https://www.mycompany.de/
– Black
Dec 13 '18 at 8:28



Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]