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

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.

This question is related to ip host shared-hosting forward

The answer is


You can access you website using your IP address and your cPanel username with ~ symbols. For Example: http://serverip/~cpusername like as https://xxx.xxx.xx.xx/~mohidul


serverIPaddress/~cpanelusername will only work for cPanel. It will not work for Parallel's Panel.

As long as you have the website created on the shared, VPS or Dedicated, you should be able to always use the following in your host file, which is what your browser will use.

67.225.235.59 somerandomservice.com www.somerandomservice.com


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


Include the port number with the IP address.

For example:

http://19.18.20.101:5566

where 5566 is the port number.


Examples related to ip

Can't access 127.0.0.1 Correct way of getting Client's IP Addresses from http.Request How to get the IP address of the docker host from inside a docker container How to access site through IP address when website is on a shared host? How to change proxy settings in Android (especially in Chrome) What is the difference between 0.0.0.0, 127.0.0.1 and localhost? socket.error:[errno 99] cannot assign requested address and namespace in python Get client IP address via third party web service Getting IP address of client IIS - can't access page by ip address instead of localhost

Examples related to host

How to mount host volumes into docker containers in Dockerfile during build How to access site through IP address when website is on a shared host? How to ping an IP address location.host vs location.hostname and cross-browser compatibility?

Examples related to shared-hosting

How to access site through IP address when website is on a shared host? PHP session lost after redirect Change primary key column in SQL Server

Examples related to forward

How to access site through IP address when website is on a shared host? What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response) forward declaration of a struct in C? java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed RequestDispatcher.forward() vs HttpServletResponse.sendRedirect()