Skip to content

Instantly share code, notes, and snippets.

@hidonet
Created October 24, 2018 02:40
Show Gist options
  • Save hidonet/76a55191317fc33b23e701f26c0f1033 to your computer and use it in GitHub Desktop.
Save hidonet/76a55191317fc33b23e701f26c0f1033 to your computer and use it in GitHub Desktop.
Pevent Wordpress PHP Upload Hack
<DirectoryMatch ^.*/wp-content/uploads/.*>
AllowOverride all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)\.php$ / [L,R=301]
</IfModule>
</DirectoryMatch>
@hidonet
Copy link
Author

hidonet commented Oct 24, 2018

Add these lines to /usr/local/apache/conf/includes/pre_virtualhost_global.conf and restart httpd...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment