Website not working if www is in URL [duplicate]
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
What might be the cause?
web-server .htaccess dns-zone magento
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.
|
show 2 more comments
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
What might be the cause?
web-server .htaccess dns-zone magento
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 useRewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
instead ofRewriteRule ^ 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 tohttps://...
. 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
|
show 2 more comments
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
What might be the cause?
web-server .htaccess dns-zone magento
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
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
web-server .htaccess dns-zone magento
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 useRewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
instead ofRewriteRule ^ 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 tohttps://...
. 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
|
show 2 more comments
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 useRewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
instead ofRewriteRule ^ 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 tohttps://...
. 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
|
show 2 more comments
1 Answer
1
active
oldest
votes
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'.
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) fromhttps://mycompany.de/
tohttps://www.mycompany.de/
– Black
Dec 13 '18 at 8:28
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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'.
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) fromhttps://mycompany.de/
tohttps://www.mycompany.de/
– Black
Dec 13 '18 at 8:28
add a comment |
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'.
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) fromhttps://mycompany.de/
tohttps://www.mycompany.de/
– Black
Dec 13 '18 at 8:28
add a comment |
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'.
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'.
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) fromhttps://mycompany.de/
tohttps://www.mycompany.de/
– Black
Dec 13 '18 at 8:28
add a comment |
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) fromhttps://mycompany.de/
tohttps://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
add a comment |
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 ofRewriteRule ^ 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