Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm looking to secure my phpMyAdmin dir from being accessed from other IPs than my own, albeit dynamic IP, let's say it is 191.164.1.xxx (xxx = being dynamic numbers).

Referring to the Apache directive allow from in .htaccess files, can I define only the first static numbers in order to allow anything starting with the defined IP numbers and let it accept any numbers in the same fashion a wildcard works in other contexts?

E.g. would would something like this work? : allow from 191.164.1.

share|improve this question

migrated from superuser.com May 7 '12 at 6:27

This question came from our site for computer enthusiasts and power users.

1 Answer 1

up vote 2 down vote accepted

Yes, if your subnet mask is 255.255.255.0 then:

    allow from 191.164.1.0/24

Will allow all hosts in that subnet. 192.164.1.1, 192.164.1.2, 192.164.1.254

share|improve this answer
    
Thanks. Just a dumb question, the ending 24, should be 254, right? –  Henrik Apr 30 '12 at 15:01
1  
No. That is CIDR notation. It is based off your network mask. You can cross reference yours with this list. old.tamasrepus.hotnudiegirls.com/pages/… –  dennis.hempler Apr 30 '12 at 15:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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