Local Network Access (LAN)
If you are on the same network you can use the server name. To know your computer name on Windows Open the Command Prompt and type hostname
:
In my case it is DEV004W
, then just access using this hostname over the net:
http://dev004w/
One observation is that your application cannot reference Resources as localhost
, example:
<link rel="stylesheet" href="http://localhost/estilo.css">
This will cause an error as you are searching for the file estilo.css
on the machine you are accessing, then refer to IP or hostname server.
Internet access (WAN)
Should you not on the same network server (machine running XAMPP/Wampp/IIS/Apache) you can use NO-IP. It is a service that provides a Free DNS for dynamic Ips.
I would set my machine IP as fixed :)
– Wallace Maxters
so I wanted to access it through a test.com address, not the machine’s IP address.
– Rafael
To my knowledge, you can do this by writing an address in the archives
hosts
windows and pointing to the IP127.0.0.1
. Now, so that the phone also recognizes the same address, I do not know if it has.– Wallace Maxters
There’s no way, @Wallacemaxters. It’s a DNS done just inside Windows. If he wants to do this, he will have to buy the domain and host the DNS for his machine. So he would have a public address.
– CypherPotato
Yes there is a way. If in the hosts files enter the ip followed by the address, any device ON THE SAME NETWORK can access usand
http://endereco/
– Alexis Garcia