6

I just start learn to create website. I create a free shared hosting (Hostinger) and uploaded my website . I can access my site by domain name but i dont known how to do it with the ip address they gave me.

> -My Domain name: mywebsitename.esy.es
> -IP: 31.170.167.204
> -Username: u935348985
> -SERVER IP: 31.170.167.195

Here is the question again: How can i access my web by the ip they gave me, not by domain name? THANK.

dante
  • 984
  • 3
  • 10
  • 24
  • 1
    Maybe this will help you: http://stackoverflow.com/questions/22043602/how-to-access-site-through-ip-address-when-website-is-on-a-shared-host – Mubashar Iqbal Apr 26 '17 at 06:18

4 Answers4

8

If you're using shared hosting, making a HTTP request to the IP alone is not enough, as the server does not know which site you're looking for. Alongside the request, you must include the Host header, with your domain included.

By default, a browser will do this from the URL you provide it - so it will obviously be empty if accessing by an IP address. Depending on your browser, you can use various extensions to manually set the headers as required.

Gareth Pulham
  • 654
  • 4
  • 10
4

There is a way to access your website with a testing URL. Use the below site and enter your server and domain details there.

https://hosts.cx/

This will create a temporary URL.

Balasubramanian S
  • 1,345
  • 12
  • 16
3

Generally you can access in shared hosting website using IP or DNS address by you have to add ~ sign before your username in below format

http://<server_ip_or_dns>/~<your_username>,

If its not working then you have to contact your web administrator.

Haresh Vidja
  • 8,340
  • 3
  • 25
  • 42
  • Which one? http://31.170.167.195/~u935348985 or http://31.170.167.204/~u935348985 or http://31.170.167.195/~mywebsitename ? Ijust check, None of it work. – dante Apr 26 '17 at 06:34
  • 1
    @dante, then contact your web administrator. :) because all web hosting provides this facility for access without domain by using ip address and username – Haresh Vidja Apr 26 '17 at 06:55
  • @HareshVidja This seems to work for me and I can access my shared hosting space. Is this the IP address I use for setting A records e.g. 143.95.38.226/~ariescom ? – HubCap May 13 '22 at 14:34
1

As mentioned by @Gareth, you can use a software like PostMan to simulate a request to your host. Just use a GET request with your server's IP address, then:

  • Click on Headers
  • Uncheck Host header
  • Add a new Host header and specify your domain name as value
  • Then Send your request
hiddeneyes02
  • 2,562
  • 1
  • 31
  • 58