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

不想你离开。 提交于 2019-11-27 12:18:16

问题


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.


回答1:


One possible way to access your website via its ip number is by including a tilde ~ and then your user name:

Example:

http://serverIPaddress/~cpanelusername



回答2:


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




回答3:


Include the port number with the IP address.

For example:

http://19.18.20.101:5566

where 5566 is the port number.




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/22043602/how-to-access-site-through-ip-address-when-website-is-on-a-shared-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!