R
R
rinaz222019-12-06 23:31:34
htaccess
rinaz22, 2019-12-06 23:31:34

How to deny access to a directory with a specific name?

Hello! There is a tovar directory, it contains a bunch of other directories (test1, test2, etc.). These directories (test1, test2, etc.) may contain admin directories. How to deny access to the admin directory?
Those. should work something like this:
product / * / admin The
question may be simple, but for me it is complicated)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jack Williams, 2019-12-06
@JackWilliams

Make a normal folder structure and there will be no problems. I don’t think that in your case there is an urgent need to make so many folders admin
. In general, if you really want to hide something, then give a 404 error :
This way, the hacker will not even know that there is something in this path.
If you give 403 Forbidden Error , then this will only provoke the hacker and he will continue the attack.
This is an amateur protection, of course, but judging by your question, you do not need subtleties.

M
maseeq, 2019-12-07
@maseeq

In the virtualhost config write

<Location /tovar/*/admin/>
        Order allow,deny
        Deny from all
</Location>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question