Wordpress

WordPress tips: How to prevent php execution in Uploads Directory

WordPress tips: How to prevent php execution in Uploads Directory July 10, 2016Leave a comment
tutorial web design, tutorial desain web, how to disable update and install

Uploads folder is the most attack target in WordPress Website. How to prevent PHP Execution in Uploads folder?

Prevent php Execution in Uploads Directory with .htaccess

Create .htacces file in uploads folder and write this command inside:

<Files *.php>
deny from all
</Files>

Test .htaccess

You can create simple php file in uploads folder like phpinfo or other:

<?php
echo "hanya test";
?>

Now, try to load your php file trough browser. You must see 403 Forbidden Error

Leave a Reply

Your email address will not be published. Required fields are marked *