Images not displaying at all in WordPress network
-
Hi,
I’m running WordPress Multisite on WordPress 3.3.1 and uploaded images are not showing on network sites.
Example: http://a1bc.fra1.net/2012-summer-of-cricket/ (there should be an image above ‘Click on the image to enter site’).
Based on what I’ve read in the other similar support requests, it probably has something to do with the .htaccess file, viz:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files # RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteRule ^.*/files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L] </IfModule> <Files 403.shtml> order allow,deny allow from all </Files> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteCond %{HTTP_HOST} ^fra1\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.fra1\.net$ RewriteRule ^intelligence$ "http\:\/\/intelligence\.fra1\.net\/" [R=301,L]
Hotlink protection is disabled.
-
Not knowing how your network is setup, it’s hard to say what the right code should be. But, your problem is with
# RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteRule ^.*/files/(.+) wp-includes/ms-files.php?file=$1 [L]
The post and image you provided as an example has would actually match the rule that is commented out and will not match the rule that is currently active. Is there a reason why it’s setup that way?
And you have WordPress crap in there multiple times. Wow. You didn’t remove your old WordPress stuff before adding. Assuming SUBDOMAINS, this would be better:
<Files 403.shtml> order allow,deny allow from all </Files> RewriteCond %{HTTP_HOST} ^fra1\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.fra1\.net$ RewriteRule ^intelligence$ "http\:\/\/intelligence\.fra1\.net\/" [R=301,L] # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . index.php [L] # END WordPress
Always put WP at the bottom, so it’s the last thing parsed. This prevents multiple calls to WordPress and should keep your memory lower.
Yes that fixed it – thanks.
- The topic ‘Images not displaying at all in WordPress network’ is closed to new replies.