{"id":956,"date":"2020-08-27T02:28:51","date_gmt":"2020-08-27T02:28:51","guid":{"rendered":"http:\/\/angelwings.net\/blog\/?p=956"},"modified":"2020-08-27T02:28:51","modified_gmt":"2020-08-27T02:28:51","slug":"prestashop-stop-subdomains-from-keep-redirecting-to-main-domain","status":"publish","type":"post","link":"https:\/\/angelwings.net\/blog\/prestashop-stop-subdomains-from-keep-redirecting-to-main-domain\/","title":{"rendered":"Prestashop: Stop subdomains from keep redirecting to main domain"},"content":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem\/?tab=comments#comment-2634035<\/p>\n<p>After installing prestashop, created subdomains don&#8217;t work properly due to the .htaccess rewrite conditions automatically created by prestashop.<\/p>\n<p>Add the following right at the end to solve this issue<\/p>\n<p>RewriteCond %{HTTP_HOST} !^www\\.<br \/>\nRewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/$1 [R=301,L]<\/p>\n<p>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/p>\n<p>some additional ones to try in case doesn&#8217;t work<\/p>\n<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem\/?tab=comments#comment-3116242<\/p>\n<p>#First condition, If is HTTPS without wwww, redirects to www.<br \/>\nRewriteCond %{HTTPS} on<br \/>\nRewriteCond %{HTTP_HOST} !^www\\.<br \/>\nRewriteRule ^(.*)$ https:\/\/www.%{HTTP_HOST}\/$1 [R=301,L]<\/p>\n<p>#Second condition, If is not HTTPS and without www, redirects to HTTPS with WWW.<br \/>\nRewriteCond %{HTTPS} !=on<br \/>\nRewriteCond %{HTTP_HOST} !^www\\.<br \/>\nRewriteRule ^(.*) https:\/\/www.%{SERVER_NAME}\/$1 [R,L]<\/p>\n<p>#Third, If is not HTTPS and have www, redirects only to HTTPS<br \/>\nRewriteCond %{HTTPS} !=on<br \/>\nRewriteCond %{HTTP_HOST} ^www\\.<br \/>\nRewriteRule ^(.*) https:\/\/%{SERVER_NAME}\/$1 [R,L]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/www.prestashop.com\/forums\/topic\/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem\/?tab=comments#comment-2634035 After installing prestashop, created subdomains don&#8217;t work properly due to the .htaccess rewrite conditions automatically created by prestashop. Add the following right at the end to solve this issue RewriteCond %{HTTP_HOST} !^www\\. RewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/$1 [R=301,L] \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ some additional ones to try in case doesn&#8217;t work Source: https:\/\/www.prestashop.com\/forums\/topic\/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem\/?tab=comments#comment-3116242 #First condition, If is HTTPS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[103,105],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-troubleshoot","tag-prestashop","tag-prestashop-1-6"],"_links":{"self":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelwings.net\/blog\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}