How to access site through IP address when website is on a shared host?

Andrew Tsay picture Andrew Tsay · Feb 26, 2014 · Viewed 157.7k times · Source

I want to edit my host file to forward a website to another IP, but that IP is on a shared host, so the IP doesn't take me to the domain I want. Is there a way around this?

i.e. Website: http://somerandomservice.com/

Ping the site and go to: 67.225.235.59

But they're different sites.

Thanks!

Update: Tried nmap, but unable to find the correct port.

Answer

user604234 picture user604234 · Oct 11, 2015

According with the HTTP/1.1 standard, the shared IP hosted site can be accessed by a GET request with the IP as URL and a header of the host.

Here there are two examples(wget and curl): $ wget --header 'Host:somerandomservice.com' http://67.225.235.59 $ curl --header 'Host:somerandomservice.com' http://67.225.235.59

Resources:

https://en.wikipedia.org/wiki/Shared_web_hosting_service

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23