w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How I can restrict access to files with htaccess from all IPs except one?

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

# If IP is not
RewriteCond %{REMOTE_ADDR} !^$
# block access to all .php files
RewriteRule .php$ - [F,NC]

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.