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 ?
Asked
Active
Viewed 2.3k times
3 Answers
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/sessionis 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/magentocommands. – 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
-
2
-
Clear cache manually, clear cookies and try with a different browser since the http to https redirect it might be cached at a browser level. – mbalparda Aug 01 '14 at 17:17
-
1I have emptied var/cache. I have tried with other browsers now, but still same result – Nishanth Lawrence Reginold Aug 01 '14 at 17:21
-
Is something in your .htaccess forcing you into SSL? Any other config you changed in the admin ? – mbalparda Aug 01 '14 at 17:36
-
I have Rewrite Engine as ON. Should I change this ? – Nishanth Lawrence Reginold Aug 01 '14 at 17:47
magerun config:set web/url/redirect_to_base 0– Willem Apr 13 '16 at 14:38