从网络上的其他计算机在浏览器上加载html

I have a bit of problem. I have created an HTML file on my desktop. I want to access this html file on a browser from my laptop which is connected on the same network with my desktop. How can I get it to work? I am using WAMP on my desktop. What I want to happen is that, when any devices connected to my network (tables, phones, laptops) typed in their browser "orders/" the orders.html file from my desktop will be loaded.

You need to run a server on the machine hosting the file. If the machine is a Mac its very easy, there's a built-in web server. For Windows its a bit tougher, but you still need a server.

Fortunately its really easy these days. There's a simple tool called Forward you can install in a minute and it'll run a server. https://forwardhq.com/#

  1. Create a virtual host in wamp which points to the parent folder of that html file.
  2. Give a fake domain that vhost like files.mydomain.local
  3. Now you need to tell other devices on network about this "hey, there is a local domain named files.mydomain.local which points to my ip address 192.168.X.X". There are two options to do this:

Option A :

Put this information by adding a new line to each device's hosts file (For windows: c:\windows\system32\drivers\etc\hosts For macs: /etc/hosts )

127.0.0.1    localhost
::1          localhost
192.168.X.X  files.mydomain.local # Change 192.168.X.X with your local ip

Option B :

Roll your very own DNS server. (This will not be easy if you don't have enough knowledge about DNS and network systems)

If the address to open your html file in your desktop is
http://localhost/orders/orders.html
on your laptop you need to open
http://your-desktop-ip/orders/orders.html,
eg.- http://192.168.0.2/orders/orders.html