Home › Forums › BulletProof Security Pro › Multisite images not displaying
- This topic has 10 replies, 2 voices, and was last updated 11 years ago by tapps.
-
AuthorPosts
-
tappsParticipant
i didn’t notice this at first, but it was brought to my attention that all the images are now broken on a sub site of our website.
the website is a wordpress mutlisite setup, and we just upgraded to BPS pro on the main site. now all the images on the sub sites (example: http: //ofh.milwaukeesynod.org/ and http: //welca.milwaukeesynod.org/ ) are broken. any idea on why this happened?
thanks
AITpro AdminKeymasterI assume the problem that is happening is this problem in the link below, but the problem could also be that older Network/Multisite .htaccess code is being used.
Image file paths are…
welca.milwaukeesynod.org/files/2012/01/welcalogo.png
ofh.milwaukeesynod.org/files/2012/01/o4hlogo.png…on these Network/Multisite subdomain sites so since /files/ is shown in the URL path to image files that would indicate that this site was first installed using WordPress 3.4.2 or below. New Network / Multisite sites installed using WordPress 3.5 or above will show /uploads/ instead of /files/ in the image file URL path. But if this site was first installed with WordPress 3.5 or above then that could be the problem since the .htaccess code has changed for WordPress Network/Multisite sites as of WordPress 3.5 and the image file URL path will be incorrectly rewritten in the older .htaccess rewrite code.
New WordPress Network/Multisite .htaccess code based on WordPress version
http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_RewriteWhat type of Network/Multisite installation is this? sudirectory or subdomain?
What version of WordPress did you first install this Network/Multisite site? WordPress 3.4.2 or below or 3.5 or above version?
How are the subdomains created? Using a plugin, using A or CNAME DNS records? Are you using a domain mapping plugin?
Once you have answered the questions above I can then tell you what needs to happen next.BPS Pro 8.0 is scheduled for release later today and the Primary focuses are Network/Multisite Network Activation or single site activation for BPS Pro and new code for Network/Multisite sites based on WordPress version installation – WordPress 3.4.2 or below or 3.5 and above.
http://forum.ait-pro.com/forums/topic/network-multisite-read-me-first/
tappsParticipantthanks for the response.
yes. this was a multisite install… originally created back in 2011… so yes it was pre WP3.4 (hence the default “files” directory instead of “uploads”)
yes. a subdomain setup for the multisite.
and as for the subdomains, if i remember correctly, was done with the domain records and not a plugin. but where would i go to verify this information?AITpro AdminKeymasterOk most likely the problem is going to be the old common problem that is listed in this link.
I am copying the relevant info from the link above to make this easier to reference and will create a new post to ask some additional questions.
[removed-obsolete]RewriteRule ^blah1/files/(.*)$ http://www.example.com/wordpress/wp-content/blogs.dir/5/files/$1 [L,R=301] RewriteRule ^blah2/files/(.*)$ http://www.example.com/wordpress/wp-content/blogs.dir/6/files/$1 [L,R=301]
[removed-obsolete]
#RewriteEngine On #RewriteBase / #RewriteRule ^wp-admin/includes/ - [F,L] #RewriteRule !^wp-includes/ - [S=3] #RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] #RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] #RewriteRule ^wp-includes/theme-compat/ - [F,L]
AITpro AdminKeymasterWhat I want to know first is did you click the correct [removed-obsolete] buttons for your Network/Multisite site type and activate BulletProof Mode on the Primary site ONLY?
Next do you see this .htaccess code below in your root .htaccess file? If so, delete it or comment it out with # signs as shown below.
#RewriteEngine On #RewriteBase / #RewriteRule ^wp-admin/includes/ - [F,L] #RewriteRule !^wp-includes/ - [S=3] #RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] #RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] #RewriteRule ^wp-includes/theme-compat/ - [F,L]
Next did you create RewriteRules like these shown below at any time for this Network/Multisite site?
RewriteRule ^blah1/files/(.*)$ http://www.example.com/wordpress/wp-content/blogs.dir/5/files/$1 [L,R=301] RewriteRule ^blah2/files/(.*)$ http://www.example.com/wordpress/wp-content/blogs.dir/6/files/$1 [L,R=301]
tappsParticipantyes. when i originally installed the free BPS plugin yes. i made sure to only click the multisite buttons. and everything worked fine. (and that was running on the site successfully for over a year)
however, when i installed the PRO version last week, i actually had made an account for AIT to install it since nothing was working for me. after you guys installed /set up the plugin on the main site, i never thought to check the sub sites to see if the images weren’t working. but that was when they all broke… when i upgraded from the free to the pro version.
tappsParticipantas for the .htaccess rules… i found these two:
# WP REWRITE LOOP START RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
but i’m not sure what that means. and as for adding whatever rules with the multisite.. does that mean i need to manually add rules every time we create a new subsite/subdomain? that seems a bit cumbersome if so.
AITpro AdminKeymasterThere are no differences between the root and wp-admin .htaccess files in BPS free and BPS Pro. They are exactly the same. BPS Pro B-Core functions exactly the same as BPS free htaccess Core in regards to the root and wp-admin .htaccess files. There are of course many additional things added to B-Core in BPS Pro, but the root and wp-admin .htaccess files are identical in free and Pro.
Instead of trying to figure out what has happened on this site here just send me a Super Admin login to this site so I can see what happened. I assume it is a simple mistake that can be easily corrected. Send the login information to: edward at ait-pro dot com. Thanks.
AITpro AdminKeymasterObsolete BPS no longer uses this feature:
Ok logged in and checked your root .htaccess file and it was a root .htaccess file for a WordPress single site installation and not a Network/Multisite subdomain root .htaccess file. I would not be surprised if I made this mistake and activated the wrong type of .htaccess file on your site the last time I logged into your site.
I have added additional CSS visual styling in BPS Pro 8.0 that will hopefully make clicking the wrong [removed] buttons a problem of the past for me included. 😉
I clicked the correct Network/Multisite subdomain [removed] button and activated Root folder BulletProof Mode and your images are displaying correctly on your subdomain subsites now. Logged out of your site now. Please either change this login to a Subscriber Role login or delete this user account. Thanks.
AITpro AdminKeymasterAlso I believe the information that I posted above about adding additional RewriteRules for image file problems on subsites is outdated. I am pretty sure that the image problems no longer occur in WordPress since the last time someone asked me about that was years ago. So I assume WordPress fixed something in the WP Core so that the above old fix is no longer required anymore.
tappsParticipantawesome. thanks much! i’ll go delete that account now.
-
AuthorPosts
- You must be logged in to reply to this topic.