404 On Multisite – .htaccess problem
-
I’ve installed this plugin on a 4.1 Multisite network. Every file that I secure (I secure them after plugin install, manually) — goes to a 404 page when I try to view it.
I believe the cause to be in the .htaccess rewrite rules. Reason being, the 404 error message is being generated by the statement:
if( ! $upload_dir['base_dir'] || ! is_file( $file ) ) {in the mgjp_mv_get_file function. It seemed that the URL it was getting was wrong (tested with var_dumps in various spots), even though the requested URL was, indeed, correct (I followed the path). I eventually identified the inconsistency and it’s happening when the URL is passed in to the function above’s caller (on the init hook) in the $_GET variable.If I make a request like so:
domain.com/wp-content/uploads/sites/7/_mediavault/2014/12/image.jpgIt changes it to:
domain.com/wp-content/uploads/_mediavault/2014/12/ConEd.jpg which clearly doesn’t exist (where’s the sites folder?)I believe this is an error in the .htaccess rules, but I don’t know how this could be remedied.
For reference, I’ve included my .htaccess rules below. This is exactly what we need for an important project, so it would be absolutely wonderful if we could get it working.
Thanks.
HTACCESS Rules:
RewriteRule ^(?:[_0-9a-zA-Z-]+/)?wp-content/uploads(?:/sites/[0-9]+)?(/_mediavault/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L] RewriteCond %{QUERY_STRING} ^(?:.*&)?mgjp_mv_download=safeforce(?:&.*)?$ RewriteRule ^(?:[_0-9a-zA-Z-]+/)?wp-content/uploads(?:/sites/[0-9]+)?(/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L](Had to hand copy this from SSH so if there is an incidental typo, it most likely is a copy error and not a real error).
The topic ‘404 On Multisite – .htaccess problem’ is closed to new replies.