You appear to be a bot. Output may be restricted
Description
Retrieve the .htaccess rules to wp-content/uploads/edd/
Usage
$mixed|void = edd_get_htaccess_rules( $method );
Parameters
- $method
- ( bool ) optional –
Returns
mixed|void The htaccess rules
Source
File name: easy-digital-downloads/includes/admin/upload-functions.php
Lines:
1 to 28 of 28
function edd_get_htaccess_rules( $method = false ) { if( empty( $method ) ) $method = edd_get_file_download_method(); switch( $method ) : case 'redirect' : // Prevent directory browsing $rules = "Options -Indexes"; break; case 'direct' : default : // Prevent directory browsing and direct access to all files, except images (they must be allowed for featured images / thumbnails) $allowed_filetypes = apply_filters( 'edd_protected_directory_allowed_filetypes', array( 'jpg', 'jpeg', 'png', 'gif', 'mp3', 'ogg', 'webp' ) ); $rules = "Options -Indexes\n"; $rules .= "deny from all\n"; $rules .= "<FilesMatch '\.(" . implode( '|', $allowed_filetypes ) . ")$'>\n"; $rules .= "Order Allow,Deny\n"; $rules .= "Allow from all\n"; $rules .= "</FilesMatch>\n"; break; endswitch; $rules = apply_filters( 'edd_protected_directory_htaccess_rules', $rules, $method ); return $rules; }