Uploads Folder “Deny From All” 403 Error

[ad_1]

Hey there!

After the latest update, the below changeset created 403 errors in the wp-content/uploads folder and files could not be loaded anymore.

function fep_create_htaccess_index( $path ) {
	if ( wp_is_writable( $path ) ) {
		wp_mkdir_p( $path );

		if( ! file_exists( $path . '/.htaccess' ) ){
			// Create the file if it doesn't exist
			file_put_contents(  $path . '/.htaccess', "Options -Indexes\ndeny from all\n" );
		}
		if( ! file_exists( $path . '/index.php' ) ){
			// Create the file if it doesn't exist
			file_put_contents(  $path . '/index.php', "<?php\n// Silence is golden." );
		}
		
	}
}

Removing the deny from all line from the created .htaccess file immediately fixed all issues and the website loaded as expected.

I cannot be sure if this has anything to do with the shared hosting environment I am using, but wanted to bring your attention to this in case other Front End PM users/customers are facing the same issue.

Thank you!
Kris

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer