After changing the base url to a non-existing site . Now if I refresh my page 404 error occurs.. and admin panel is also not working

magento.stackexchange https://magento.stackexchange.com/questions/181770

  •  10-10-2020
  •  | 
  •  

Question

I am learning Magento2 and tried creating a store view through admin panel and changed the base URL to a non existing site. now after save config I don't able to access the admin panel or my site.?? 404 error occurs.! How to change my base URL to default site's base URL using command line and revert the changes that I have made.? thank you in advance! please help me.!

Was it helpful?

Solution

You want to change base URL using Commmand line, Run below command

php bin/magento setup:store-config:set --base-url="http://example.com/"

php bin/magento setup:store-config:set --base-url-secure="https://example.com/"

php bin/magento cache:clean

update:

 remove all content<magento-root-dir>/var* 

Then run below command: remove all content(not remove .htaccess)/pub/static/* Then run below command:

php bin/magento setup:static-content:deploy

php bin/magento cache:clean

Then check it, if you have any issue let me know

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top