{"id":305,"date":"2018-07-25T15:51:04","date_gmt":"2018-07-25T15:51:04","guid":{"rendered":"http:\/\/www.evermoretechnologies.com\/blog\/?p=305"},"modified":"2018-07-25T15:51:04","modified_gmt":"2018-07-25T15:51:04","slug":"redirect-loop-on-magento-2-web-installer","status":"publish","type":"post","link":"https:\/\/www.evermoretechnologies.com\/blog\/2018\/07\/redirect-loop-on-magento-2-web-installer\/","title":{"rendered":"Redirect Loop on Magento 2 web installer"},"content":{"rendered":"<p>I was setting up a new Magento 2 installation for a project.\u00a0 It&#8217;s the first time I&#8217;ve done it from scratch for a long time.<\/p>\n<p>I setup the code, vhost, host file rewrite to my local vm, etc.\u00a0 Went to http:\/\/mydomain.local\/ and got redirected to http:\/\/mydomain.local\/setup with a message saying &#8220;Too many redirects.&#8221;<\/p>\n<p>It turns out that if you setup your vhost the right way and point to {magento-root}\/pub the web installer doesn&#8217;t work.<\/p>\n<p>The fix was to point the vhost to {magento-root}, run the web installer then change the vhost root back to {magento-root}\/pub.<\/p>\n<p>In apache it looked like this for the install:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">&lt;VirtualHost *:80&gt;\r\n        ServerName mysite.local\r\n        DocumentRoot \/var\/www\/mysite\/httpdocs\r\n        &lt;Directory \"\/var\/www\/mysite\/httpdocs\"&gt;\r\n                Options Indexes FollowSymLinks MultiViews\r\n                AllowOverride All\r\n                Allow from all\r\n                Require all granted\r\n        &lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>Then I changed it back to this for the development of the site:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">&lt;VirtualHost *:80&gt;\r\n        ServerName mysite.local\r\n        DocumentRoot \/var\/www\/mysite\/httpdocs\/pub\r\n        &lt;Directory \"\/var\/www\/mysite\/httpdocs\/pub\"&gt;\r\n                Options Indexes FollowSymLinks MultiViews\r\n                AllowOverride All\r\n                Allow from all\r\n                Require all granted\r\n        &lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Obviously the production site will have a lot more apache directives in it, or better yet, use Nginx and php-fpm with SSL directives, etc.\u00a0 But for development on a local Apache server, this works great.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was setting up a new Magento 2 installation for a project.\u00a0 It&#8217;s the first time I&#8217;ve done it from scratch for a long time. I setup the code, vhost,&#8230; <a href=\"https:\/\/www.evermoretechnologies.com\/blog\/2018\/07\/redirect-loop-on-magento-2-web-installer\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[34],"tags":[],"_links":{"self":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/305"}],"collection":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":1,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evermoretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}