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

后端 未结 4 2049
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 01:30

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?

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 02:19

    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

提交回复
热议问题