cancel
Showing results for 
Search instead for 
Did you mean: 

How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

I am installed Magento 2.3.4 in LEMP Most of the tutorial suggest use http://www.magento.local/ instead of ip address, how to change this into Nginx?

11 REPLIES 11

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

Hi @Aveeva 

You have to edit secure/unsecure url from  table 'core_config_data':

SELECT * FROM `core_config_data` WHERE `path` LIKE '%secure%'

and replace your required URL with this table.
After replace you need to flush cache:

php bin/magento cache:flush

 If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

Hi @Aveeva 

 

To access the Magento 2 URL with the domain name you need to add its entry in hosts file!

 

So open your etc/hosts file if you are using ubuntu!

 

Then you need to specify your IP address along with domain name like below :

 

192.168.1.65:8087 www.magento.local

 

Then you can access your Magento 2 via this URL - 

http://www.magento.local/

 

Refer this link for more details -

https://www.mgt-commerce.com/documentation/mgt-development-environment-usage-host-file

https://magento.stackexchange.com/questions/137824/change-localhost-url-of-magento-to-access-it-glob...

 

I hope it helps!

if issue solved,Click Kudos & Accept as Solution

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan Dave  Really thank you, after i change this  then to change url in the Store->configuration->general->web->Base url -> http://www.giri.local instead of http://192.168.1.64:8087/ error.

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

Hi @Aveeva 

 

What error it's giving can you please share the screenshots or the error log ?

 

Its helps us to troubleshoot the issue.

 

if issue solved,Click Kudos & Accept as Solution

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan DaveFinally save, and my backend url http://www.giri.local/admin_1siev0/ geting error screenshot :  https://snipboard.io/dOtLuT.jpg

 

Also configure nginx,

 

map $http_host $MAGE_RUN_CODE {
    default '';
    grocery grocery;
}

server {
	listen 8087;
        server_name www.giri.local grocery;
	set $MAGE_ROOT /usr/share/nginx/html/giri;
	include /usr/share/nginx/html/giri/nginx.conf.sample;
	error_log /usr/share/nginx/html/giri/giri_error.log;
	access_log /usr/share/nginx/html/giri/giri_access.log;
	set $MAGE_MODE developer;
	set $MAGE_RUN_TYPE website;
}

upstream fastcgi_backend2 {
        server  127.0.0.1:9000;
}

 

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan Dave  FYI frond-end & back-end return same error.

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan Dave @Bhanu Periwal  Any help to solve the issue after url updated to www.giri.local

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan DaveI hope share the details you need, there is no  error in error log, anything else i need to share?

Re: How to change localhost URL from http://192.168.1.65:8087 to http://www.magento.local/

@Manthan Dave@Bhanu Periwal   Is it necessary to add my new domain to firewall? I am using Nginx.