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

4

33

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.

Reticulum answered 26/2, 2014 at 13:58 Comment(0)
V
23

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

Verwoerd answered 11/10, 2015 at 20:14 Comment(2)
This has helped me greatly today. Thank you, kind stranger. Sorry for bumping an old post/question, but you've saved me a lot of trouble!Ox
how can you open it in the browserColley
C
9

Include the port number with the IP address.

For example:

http://19.18.20.101:5566

where 5566 is the port number.

Caporetto answered 26/2, 2014 at 14:2 Comment(3)
How do I go about finding the port number of a domain I don't own?Reticulum
If it isn't the standard 80 for HTTP, 443 for HTTPS, or 53 for standard DNS, chances are it was given a custom port by the owner of the domain and unavailable to you (without running an nmap via bash, or some other method).Caporetto
I went ahead and nmap'd 67.225.235.59 and got 13 open ports. I wasn't able to find the domain in my example above. Is there anything I could be missing?Reticulum
S
9

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

Spellbind answered 18/2, 2016 at 7:0 Comment(0)
A
0

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

Ala answered 27/11, 2016 at 1:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.