Skip to content

Instantly share code, notes, and snippets.

@isholgueras
Last active February 15, 2017 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isholgueras/b01d82fbe0e6bebcecf112a0cffc5731 to your computer and use it in GitHub Desktop.
Save isholgueras/b01d82fbe0e6bebcecf112a0cffc5731 to your computer and use it in GitHub Desktop.
.htaccess to add inside the wp-content/uploads folder in wordpress to avoid php (and others scripts) execution
RewriteEngine on
#if the file does not have one of theses extensions
RewriteCond %{REQUEST_URI} !\.(png|jpg|jpeg|gif|js|css|zip|pdf)$
#then it should be marked as forbidden.
RewriteRule .*$ - [F]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment