C
C
CucumberX2016-11-11 21:30:56
Apache HTTP Server
CucumberX, 2016-11-11 21:30:56

How to close the admin directory in Kohana?

Good day.
There is a site on kohana 3.2
It is necessary to close access to the admin interface (www.site.ru/admin) so that it can only be accessed from certain IP addresses. If the admin folder physically existed at the root, then this would be solved simply by adding htaccess to it with the Deny directive. But since such a folder does not exist, and the entire admin area lies in __application/classes/...
I tried to upload htaccess to each admin folder here with access blocking, but to no avail. site.ru/admin still opens. Tell me
, please, how can I solve this issue?
The htpasswd option will not work. You need to open access from exactly one IP

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Paul Denisevich, 2016-11-11
@deniamnet

I think that the best solution would be to check the IP in the controller itself, right at the beginning of the handler function. It is not necessary to hardcode the IP, you can put it in the config.

A
Alexander Sinitsyn, 2016-11-11
@a_u_sinitsin

Check the IP in the admin controller and if not the one, then issue a 404. Or check it in the root .htaccess .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question