Is it possible to access website through IP address and path to index file? - networking

Is it possible to access website through IP address with path to index file instead of domain name?
Example:
Domain: Youtube.com
IP address: 216.58.209.142
Trying to access the website through IP address won't work. I understand this is because there can be multiple websites on the same IP address and the settings which directory gets sent to the user is set in nginx/apache.
Is it possible to visit the said website through for example 216.58.209.142/youtube/path/to/directory/index.html ?
If this works then how would I be able to get the full URL path?
Just curious, I'm not trying to achieve anything particular.

In general it's not possible.
Server can block your request even if you provide a correct/existing path, allowing you to access the data only using a correct domain name.

Just replace the www.youtube.com with YouTube's IP. For example: 216.58.209.142/index.html (I don't know if YouTube has index.html, but if it did that's how you would access it)

Related

How to access website using hostname instead of ip address?

I am working on a wordpress website and I'm unable to access my website using the host-name. [However, I'm able to access my website through the ip address. For example, when I enter 10.20.0.18, I'm directed to 10.20.0.18/wp-admin/plugins.php]
I am new to hosting and I was just able to update my hosts file and properly link the ip address to hostname by reading through some articles.
I also checked these links are correct using ping command.
For example, my hosts file looks something like this,
#Host file starts here
127.0.0.1 localhost
10.20.0.18 www.webserver.abc.com
66.155.40.202 api.wordpress.org
#End of host file
Now, when I try to access the website using hostname through my web browser, I get this error.
This site can’t be reached www.webserver.abc’s server IP address could not be found.
I am not sure where I am going wrong, or do I need to make some more changes in other files?

Hosting subdomain without a name domain nginx

I want to add a subdomain to my server. I do have have an ip address given by the hosting server but I don't have the name domain yet. Is it possible to host like:
subdomain.152.235.235.85 <-- I tried this by Is not working for me, perhaps this is not possible
Or is there a better way to have subdomain without having a name domain yet?
If you want use this site for few devices, you can add to file hosts your domain: 152.235.235.85 subdomain.test.site
But just add subdomain to IP is impossible.

How to block 127.0.0.1:8080

I am trying to block http://127.0.0.1:8080/ in C:\Windows\System32\drivers\etc host file. so what i did is:
127.0.0.5 http://127.0.0.1:8080/AccessCtrl/login.jsp
But is not working, i can still access this site.
As I know ,hosts file is for DNS caching .
I mean one side must be an IP address and the other side must be Domain name server. So you can't do such a thing.
The hosts file only maps domain names (e.g. www.example.com) to ip addresses.
Therefore your approach won't work for two reasons:
What you're trying to block is not a domain name, but a URL
The URL you're trying to block doesn't contain a domain name, but an IP address.
You should be able to "block" the domain "localhost" this way, but you'd still be able to access http://127.0.0.1:8080/, just not http://localhost:8080/.
What you need here is a firewall, like the windows firewall.

How to give Alias name for My Website

I have deployed my ASP.Net Site in one of our server which is in ip format. So, I used to browse it like… http://xx.xx.xx.xx/MySite
But, I want to get out of this IP and give some text. How can I achieve this.
Also, I can’t change the Host alias name.
you can add name for ip address in file [windows directory]/system32/drivers/etc/hosts but it works only on local machine. If you want solution for network, you should have access to DNS server
Your server definitely has a name. You can use this name to access your site instead of ip address. smth like http://myserver/MySite
Thanks,
Arty

redirect domain name to local network internal ip (no requirement for external access)

i want to do the following:
open a web browser on my local network. type in mydevice.com(or something similar) and have the browser redirect to the actual device (192.168.1.x)
the reason is, it really is NOT for me. it is for a product that hosts a web page and i do not want the users to have to type in the IP address.
also, i am aware of dyndns.org and related sites. i was wondering though if there isnt another (easier) alternative since i have no requirement whatsoever to get IN from OUTSIDE (i.e. no external access). i pretty much just want to tell my router whenever it sees a request for some made up domain name, to instead just redirect to a specific IP address on the local network. the only question then will be, if such a thing is possible, is it easy enough to instruct said users to set up.
is such a thing possible?
ps - somebody may have to change my problem title... i didnt know what this was called, which made it hard to google in the first place. so i turn to SO, but then naturally, have trouble writing a specific title
You could use a Hosts file. See Wiki Hosts file entry for the format for your OS.

Resources