cancel
Showing results for 
Search instead for 
Did you mean: 

redirect loop after base_url change

redirect loop after base_url change

Dear Community,

 

I ran into this devious issue when I had to change the base url for a demo site on which we are learning the features of the new magento. The site is running on an internal VM and I need to set a public access to it with a subdomain that is handled by an nginx proxy. 

When I change the base_url store settings on the admin page after I save the page redirects then soon I receive an error message from the browser ERR_TOO_MANY_REDIRECTS. The frontend works fine but I can't reach the admin site.

I get the same result when I change setting directly in the db.

unsecure and secure urls are set correctly, use_secure_admin is turned off, I've tried cleaning the cache, turning it off, I turned off rewrites and I'm clearing the cookies as well. Nothing helped so far. 

Any idea?

 

 

3 REPLIES 3

Re: redirect loop after base_url change

@kerdibCan you put more details like you have multi-website setup. In case of yes which is your default store. Where did you change the URL, Default or website level. For admin you would need to update the URL in default config.

 

Thanks!

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: redirect loop after base_url change

Hi,

 

Thanks for the reply.

This is a single store website. Now that you ask I might have only changed the website level config on the admin page, however I've got the same results by changing the base_url rows in core_config_data table which I'm pretty sure is the default.

 

Anyway we couldn't solve the problem yet but now we know the nginx proxy has something to do with it. Since we used a workaround and skip the proxy, the site seems to work perfectly.

Re: redirect loop after base_url change

  1.  First thing to check is the ssl certificate is "www.yourdomain.com" or just "yourdomain.com"
  2. you have to enter the same way in magento base secure url and unsecure url, if entered wrongly it may keep redirecting from www.example.com to example.com so we need to fix this
  3. go to your phpmyadmin database and find "core-config-data" table
  4. check the path and values of ---- web/unsecure/base_url and web/secure/base_url --- values should be same as in ssl certificate.
  5. rm -rf var/cache
  6. php bin/magento indexer:reindex