5

I have enabled it in the Web category under system. I have lost my admin access due to the https problem so I would like to disable the forced redirect. Is there a way to do that using db or shell ?

3 Answers3

3

Disable URL redirect through shell:

echo "update core_config_data set value = 0 where path = 'web/url/redirect_to_base'" | mysql $MAGENTO_DB
n98-magerun cache:flush
Willem
  • 1,488
  • 10
  • 19
2

Removing var/session content will clear your customers sessions. So if you don't have any other choice this could be help you but with some disadvantages. This is why the solution is not recommande in a PRODUCTION environment.

This worked for me:

Start by removing all https from your config

UPDATE core_config_data
SET value=REPLACE(value, 'https', 'http') 
WHERE value LIKE 'https%';

Then remove the secure redirection

UPDATE core_config_data
SET value=0
WHERE path='web/secure/use_in_frontend' OR path='web/secure/use_in_adminhtml' OR path='web/url/redirect_to_base';

And the most important after this: delete content of

  • var/cache
  • var/full_page_cache
  • var/session
Akira
  • 49
  • 4
  • Deleting var/session is never an appropiate solution. http://magento.stackexchange.com/questions/94589/keeping-customers-logged-in-after-deleting-var-session – Fabian Schmengler Sep 14 '16 at 10:54
  • I understand this is an old response, however rather than deleting the cache run the you could run php bin/magento cache:flush after you run the SQL queries in the answer. – NathanielR Aug 15 '19 at 15:10
  • @NathanielR This is a Magento 1 question, there was no bin/magento commands. – Cladiuss Oct 22 '19 at 10:08
  • You should not do this, there might be some third party modules which have entries which require https – Black Nov 11 '22 at 13:41
1

Go to your database and put your URL without https where path = web/unsecure/base_url and where path = web/secure/base_url.

mbalparda
  • 7,363
  • 3
  • 23
  • 46