2

I want to only allow a private IP range to be able to access the administrator panel on my site.

I found an article explaining how to do it for a specific directory path, such as /var/www/admin/, but not by URL. I am unable to use the exact directory path because I'm using an MVC framework that doesn't have static files I can point to.

Is it possible to do this in a virtual host configuration?

The pseudo code in my head would look something like this,

<Directory $domain/admin>
  Order allow,deny
  Allow from 192.168.1.0/24
</Directory>
3

You can use the <location> block

<Location /admin>
    Order Allow,Deny
    Deny from  all
    Allow from 192.168.1.0/24
</Location>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.