.htaccess: how to restrict access to a single file by IP?

前端 未结 4 801
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 07:55

I\'ve look all over, but keeps running into same info that talks about directory level IP restriction, which usually looks something like this:

Order Deny,A         


        
4条回答
  •  鱼传尺愫
    2020-12-01 08:47

    For a more up to date Apache 2.4 example:

    
        Require ip 123.123.123.123
    
    

    Here are the more in depth docs for additional options and examples: https://httpd.apache.org/docs/2.4/howto/access.html and the docs for the directive: https://httpd.apache.org/docs/2.4/mod/core.html#files

    Note that can be nested inside sections to restrict the portion of the filesystem they apply to.

提交回复
热议问题