K
K
Konstantin Maslennikov2021-12-01 00:17:51
Domain Name System
Konstantin Maslennikov, 2021-12-01 00:17:51

How to disable one of the url addresses?

Greetings! The task may sound crazy, but it exists

There is a domain.com address and there is a domain.com/folder/ address | domain.com/textfile.txt
It is necessary to completely hide the domain.com address, i.e. so that the browser gives an ERR_NAME_NOT_RESOLVED (dnserror) error, but the other two addresses work normally.
ps It's all on the same domain.

I can not figure out which way to dig, I will be grateful for any advice)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Ivan Shumov, 2021-12-01
@inoise

This cannot be done because these are different parts of the process. DNS resolve knows nothing about uri and http. The reverse is also true - if we are processing an http request, then dns resolve has already been successfully completed and we cannot get this error

W
wisgest, 2021-12-01
@wisgest

Simulate the appropriate error page. Preferably considering User-Agent.

R
Rsa97, 2021-12-01
@Rsa97

None. If the browser cannot get the IP of the server by the domain name, then it will not be able to reach any content that lies on this domain.

T
TheAndrey7, 2021-12-01
@TheAndrey7

i.e. for the browser to give an error ERR_NAME_NOT_RESOLVED (dnserror)
For your task by URL, this is not possible. If to do inaccessible, then all domain entirely.
I can not figure out which way to dig, I will be grateful for any advice)
towards the web server. For example, Nginx has a special code 444 to close the connection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question