Why can I not use modrewrite on the /wp-content/uploads directory?

Created by WpWorld Support, Modified on Thu, 07 Dec 2023 at 08:16 AM by WpWorld Support

The error rewrites_uploads_blocked refers to a security rule implemented into our system to protect WordPress sites on our platform – it prevents mod_rewrite rules from working from within your uploads directory, which is a common target for malware and attacks.

This rule is built into our cloud hosting platform due to it's unlimited nature to prevent abuse, and as such is not possible to disable. Should you need to have content within your uploads folder make use of mod_rewrite rules, you’ll need to  change the upload directory within your WordPress install

How do I change the uploads directory on my WordPress site?

Should you wish to take the option to change your WordPress site’s uploads directory, you’ll need to do the following:

  1. 1. Access your site via the File Manager within your WPPanel, or use FTP to connect to your site.
  2. 2. Navigate to wp-content, and create a new folder with the name you want to use for your new Uploads folder.
  3. 3. Navigate to your wp-config.php file and open it.
  4. 4. Scroll down until you see the line:
/* Add any custom values between this line and the "stop editing" line. */

And beneath that, add the following:

define('UPLOADS',’wp-content/yourfoldername’);

Replacing yourfoldername with the name of the folder you created.

Once done, save the file and close it.

This will change your uploads folder globally, and newly uploaded files will be moved to this directory instead without that limitation. .

Note: Previously uploaded files will not be moved automatically – you will need to move any pre-existing files in your uploads folder to the new folder you created.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article