htaccess access to file by ip range

前端 未结 7 2133
南笙
南笙 2020-12-05 02:03

How to allow access to file only to users with ip which are in a range of ip addresses?

For example file admin.php. and range from 0.0.0.0 to 1.2.3.4.

I need

7条回答
  •  无人及你
    2020-12-05 03:00

    Just do this for a single IP:

    
    order deny,allow
    deny from all
    allow from 1.2.3.4
    
    

    If you want to do it for a range like 10.x.x.x, then do this:

     
    order allow,deny 
    allow from 10
    deny from all
    
    

提交回复
热议问题