Search code examples
.htaccessserverdnsip

Can I run website only with server IP without domain name?


Can I run my website index.html file without domain name and run it only with server IP and directory?


Solution

  • Sure you can, just request it from your server: http://<server-ip_address>/index.html, where you replace <server-ip_address> with the actual IP address. So for example http://192.0.2.34/index.html, assuming that we are talking about an IPV4 address and that this address can be reached in the sense of network routing and firewalls.

    This is only possible using the not encrypted http protocol, since https requires a valid ssl certificate issued to a valid domain name that matches the server's host name. Which is simply impossible here since that host name is the IP address in this case. Any attempt to use https will result in the browser blocking the request for security reasons.