Local networks (that are behind a typical wifi Router) use outside DNS servers that the Router assigns and provides to them (which it itself gets from your ISP via DHCP). Unless you are willing to run your own DNS servers, there are only a limited number of ways that a local website can be reached by the other LAN systems.
To get every LAN connected device to find and connect to a website, you either have to:
A. Connect directly via the LAN server’s IP address, using that IP in the URL:
B. Connect via the host-name of the LAN server:
C. Connect via a global Hosts file resolved domain-name…
This is done by editing every LAN systems’ Hosts file with an entry that resolves the domain-name to the LAN IP of the server:
192.168.1.100 domain.name domain.alias1 domain.alias2 ...
This way all the other LAN systems know to which IP address to send the request to when the local Browser goes to the domain-name of the website.
D. Via the website’s domain-name, that is valid, registered (bought and paid for), and resolved to the LAN IP (via the domain’s Registrar’s DNS servers).
registered.domain.name resolved with a DNS
A record to IP
For A and B – To access a website via the LAN IP address or LAN host-name, that IP or host-name has to be assigned/added into the website’s Domain Aliases. *Make sure to turn off any redirects of the Domain Aliases to the Primary Domain Name (*select website in WampDeveloper’s Websites Tab, click Settings; or just create a website with the LAN host-name as the Primary Domain Name, and the LAN IP as one of the Domain Aliases).
Mobile devices have to be connected to your wifi, to be able to access via the LAN IP address. Otherwise, you must use a registered domain-name that has a DNS record resolving the domain-name to the LAN IP of the server, or to the Public IP (which is then “port-forwarded” in Router settings from WAN:80 to LAN:80 of server).
LAN IPs are usually reassigned/changed after reboot or power off of LAN systems and/or the Router. You’ll have to go into the Router’s configuration and settings, and make sure to manually assign the same IP to the same LAN system (by assigning that LAN IP to the server’s MAC address).
When a request comes in for a domain-name or IP address that is not assigned to any website, the first Apache VirtualHost (DefaultWebsite, localhost) gets returned.
When accessing the server directly via an IP address, you’ll only be able to access 1 website (the website that has that IP assiged as a Domain Alias)… Unless you run each website on a separate port number (8080, 8081, etc). *Some webapp scripts might not work correctly, as they expect regular port 80 access.
While iOS has an editable Hosts file, Android devices have to be rooted, and/or you have to go through complicated steps to modify their Hosts file.
Running your own DNS server is not recommended as it could be complicated to set up and operate, and the system it’s on has to always be on for everything else to work. If you do run your own DNS, you’ll need to set it’s LAN IP in the Router’s settings and make sure no other DNS servers are used.
You can host multiple websites under 1 main domain-name/website by treating the other websites as folders: C:\WampDeveloper\Websites\main.domain.name\webroot\other.domain\