3

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

3
  • 3
    Try changing the windows host file (c:\windows\system32\drivers\etc\hosts open as administrator) on the 192.168.1.8 pc and add this line. 192.168.1.9 sample.com and save it Commented Feb 6, 2019 at 9:32
  • What kind of operating system you are using (Mac, Linux, Windows,...)? On Mac or Linux operating system you need to edit the /etc/hosts file with root privileges and add at the end what @NickZulu suggested. Commented Feb 6, 2019 at 13:08
  • @sys0dm1n Updated the post Commented Feb 7, 2019 at 5:13

2 Answers 2

-1

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

Sign up to request clarification or add additional context in comments.

Comments

-1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.