Skip to content

Instantly share code, notes, and snippets.

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