Accessing localhost (xampp) from another computer over LAN network without URL changing

Viewed 396

I have already read Accessing localhost (xampp) from another computer over LAN network - how to?, but I couldn't find an answer to my question.

I have setup custom domain(virtual host like how to create virtual host on XAMPP). The local IP of this PC is 192.168.1.9 and I access to it using http://sample.test.

Now I am on another PC and it local IP addresses is 192.168.1.8. How to access http://sample.test via this PC? Is it possible to configure this pc to access to the site just using http://sample.test because URL changes(Starting URL with IP Address) break the site.

Update : I am on Windows 10 PC

2 Answers

As you are on a Windows 10 PC try editing your Windows hostfile, found at C:\Windows\System32\drivers\etc adding the line 192.168.1.9 sample.test

Edit host file in your client computer (Windows 10), it's located on C:\Windows\System32\Drivers\etc.

Add the ip and virtual domain like this and then save the file, you might have to run your text editor as administrator.

======= My Web App =======

127.0.0.1 localhost

192.168.1.9 sample.test

Related