Magento has a redirect loop

Magento website homepage has redirect loop error. When I try to open it, it goes to my old server url and gives an error:

Too many redirects appeared on the web page. Clearing the cookies for this site or allowing third-party cookies may resolve the issue. If not, it might be a server configuration problem, not a problem with your computer.

When I try to log in to the admin, I need the old server admin url without any errors.

I downloaded the new database and connected my store to the fact that it works fine, but when I connect it to the old database, it gives the same error.

Please advise me.

+6
source share
5 answers

This is not an ideal solution, but I had problems with Magento 1.9.x.

The setting was: Nginx Proxy & SSL Terminator => Apache Webserver

No matter what I did, enabling SSL triggered a redirect cycle. I narrowed down the issue to Magento, not with Nginx configurations.

Magento did not seem to know that he received a secure connection from Nginx, even if the correct headers were set.

The dirty solution was to add the code to the lowest index.php in the magento root directory (i.e. /var/www/magento ) just before the line Mage::run... , for example:

 if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) { $_SERVER['HTTPS'] = 'on'; $_SERVER['SERVER_PORT'] = 443; } Mage::run($mageRunCode, $mageRunType); 
+7
source

Incorrect permissions can also lead to this happening. Therefore, in addition to trimming the var/cache and var/session folders, continue and make sure that you have the appropriate permissions for the app , skin and includes app , includes directories, subdirectories and files. I suggest the suggested resolution setting is 644 . You can do this with a proper FTP client such as FireZilla.

+5
source

Go to table core_config_data p>

Update this value as your localhost url (or any url that you provide during installation):

web / secure / base_url // (new url)

web / unsecure / base_url // (new url)

Empty the var folder.

+3
source

I am corrected.

I manually deleted my cache, I was unable to log into my amdin, and it was fixed.

+1
source

My problem was Cloudflare, put it in development mode and it worked. This is due to the cache.

0
source

Source: https://habr.com/ru/post/944814/


All Articles