Magento 2 – Change Admin URL from HTTPS to HTTP

databasehttpsmagento-2.1magento2

While i install magento2.2.1 3rd Step
I enable use https for magento storefront and use https for magento admin

After Installation i cant view page bcoz https not support in my local machine (WAMP)
So I moved to phpmyadmin and select my database and selct "core_config_data" table… Here i change config path url from https to http.
Now i can view my website..

The problem is i cant access admin url
when i typed localhost/magento/admin it was changed to https://localhost/magento/admin/

How can i change this configuration via database or php code.

Best Answer

If it is a clean install:

  • make backup of database(just in case)
  • drop database
  • create empty database with your name and permissions so magento can access it
  • run install command from console e.g

    php bin/magento setup:install --base-url="http://example.co.uk/" --db-host="localhost" --db-name="databasename" --db-user="databaseuser" --db-password="databasepass" --admin-firstname="Yourname" --admin-lastname="Yourname" --admin-email="hello@example.co.uk" --admin-user="admin" --admin-password="setpasswordhere" --language="en_GB" --currency="GBP" --timezone="Europe/London" --use-rewrites="1" --backend-frontname="admin"

More information about install command and it's arguments can be found here http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-install.html

This will reinstall your database schema with populating it with given parameters.

DO NOT USE THIS UNDER ANY CIRCUMSTANCES IF YOU HAVE CUSTOM DATA IN YOUR DATABASE AS THIS WILL RESULT IN LOSING ABOVE MENTIONED DATA

Related Topic