Skip to content

Instantly share code, notes, and snippets.

@isholgueras
Last active February 15, 2017 08:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
.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