Skip to content

Instantly share code, notes, and snippets.

@meglio
Created February 14, 2015 03:23
Show Gist options
  • Save meglio/db3d3121cb203a021d1c to your computer and use it in GitHub Desktop.
Save meglio/db3d3121cb203a021d1c to your computer and use it in GitHub Desktop.
wp-restrictions
# Global restrictions configuration file.
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~ /\. {
deny all;
}
# Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment