Images not uploading properly on multisite

I have a multisite. One client has a site on my multisite mapped to the domain:

oprepare.com

As you can see by looking at the front page, images are no longer visible on her site, even though images used to work.

I logged into her site as a regular user to test this. I uploaded an image. It showed up in the post with a box of the size of the actual photo, but just a blue question mark like the others. When I look at the media library, there are just a bunch of squares with blue question marks in them. But when I go to each individual image using the "edit image" link, I can see the images just fine.

I have searched around for a solution have found references saying that php scripts, etc, running on the main site of a multisite could cause this. ???

Any ideas for a solution?

  • ProSapien
    • The Crimson Coder

    P.S. I found one person who said this:

    UPDATE : problem solved, I found this at htaccess main root, and disabled it. Its work likes charm now :slight_smile:

    # Protect directories
    <Files ~ "^(backup|files|images|include|lang|libs(/.+)?|temp(/.+)?|templates(/.+)?|javascripts(/.+)?)$">
      Order deny,allow
      Deny from all
    </Files>

    I'm not sure if that would work in my case. My htaccess main root is somewhat different — and I'm not sure how to "disable" it. Here is my htaccess file:

    <IfModule mod_suphp.c>
    	suPHP_ConfigPath /home/popcred/php.ini
    	<Files php.ini>
    		order allow,deny
    		deny from all
    	</Files>
    </IfModule>

    I actually tried deleting all that content in the htaccess file. It didn't solve the problem and did not seem to impact the site in any way.

    Ideas?

  • ProSapien
    • The Crimson Coder

    Here is the htaccess at the root of the public_html folder. Is that what you were referring to?

    HostGator is the host.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:X-WAP-PROFILE} !^$ [OR]
    RewriteCond %{HTTP_USER_AGENT} ^.*(Alcatel|Asus|Android|BlackBerry|Ericsson|Fly|Huawei|i-mate|iPAQ|iPhone|iPod|LG-|LGE-|MDS_|MOT-|Nokia|Palm|Panasonic|Pantech|Philips|Sagem|Samsung|Sharp|SIE-|Symbian|Vodafone|Voxtel|WebOS|Windows\s+CE|ZTE-|Zune).*$ [NC,OR]
    RewriteCond %{HTTP_ACCEPT} application/vnd.wap.xhtml\+xml [NC,OR]
    RewriteCond %{HTTP_ACCEPT} text/vnd.wap.wml [NC]
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  • Jack Kitterhing
    • Code Norris

    Hi there @ProSapien

    I hope you are well today, sorry for the delay.

    What is adding all the extra rules to the .htaccess file?
    Where is the multisite installed, in the root of the domain or in a sub domain/sub folder?

    Is this a sub directory install, where new sites unless mapped are mainsite.com/newsite or is it a sub domain where new sites unless mapped are newsite.mainsite.com?

    Was this installed as 3.5 or did you upgrade from a previous version of multisite? Are you using any caching plugins or a Content Delivery network (CDN) at all?

    Thank you!

    Kind Regards
    Jack.

  • ProSapien
    • The Crimson Coder

    I don't know where the code came from.

    The multisite is directly in the public_html folder, not a subdomain or sub folder.

    This is a subdomain install.

    When you ask "was this installed as 3.5", by "this" do you mean WordPress, a plugin, something else? I'm running WordPress 3.5.1, but the site has been up over a year, so has been upgraded.

    No caching plugins or CDN.

  • Jack Kitterhing
    • Code Norris

    Hi there @ProSapien

    Thank you for the additional information.

    By the "was this installed as 3.5" I meant if it was a upgraded install or not, which you confirmed it was :slight_smile:

    Due to this, can you remove all current rules in your .htaccess file and replace with these rules and try again please?

    # 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

    Thank you!

    Kind Regards
    Jack.

  • Charlie Pryor
    • The Incredible Code Injector

    I think those files are one in the same if I'm not mistaken (the file you are removing code from, and the one you are then pasting the new code into are the same). There is a lot of seemingly random stuff in your .htaccess file (which looks like a lot of mobile phone brands) which is what has been removed.

    So, the same htaccess file you pasted above, on the root directory... replace all the code in it (everything) and paste Jack's code in its place. It's essentially the same code as you had before, but without those mobile phone company names and the stuff surrounding them.... not sure how they got there.

    In case I'm wrong on what Jack meant, save a backup of the file that is currently there.

  • Jack Kitterhing
    • Code Norris

    Hi there @ProSapien

    I hope you are well today, @Charlie Pryor is spot on that it's too replace the code in the .htaccess file you posted with all the mobile phone brands in.

    It is a bit different though from your code currently, as the code I have pasted, was for anything from 3.1 (I believe), right up to till 3.5 was released, but when 3.5 was released the .htaccess did as well, as yours is an upgrade you should still be using the old .htaccess that I pasted, as your currently using the new one :slight_smile:

    Thank you for being a WPMU DEV member!

    Kind Regards
    Jack.

  • ProSapien
    • The Crimson Coder

    I have posted code from two different htaccess files on my server space, above, in this thread:

    Main root:

    <IfModule mod_suphp.c>
    	suPHP_ConfigPath /home/popcred/php.ini
    	<Files php.ini>
    		order allow,deny
    		deny from all
    	</Files>
    </IfModule>

    Root of public–html folder:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:X-WAP-PROFILE} !^$ [OR]
    RewriteCond %{HTTP_USER_AGENT} ^.*(Alcatel|Asus|Android|BlackBerry|Ericsson|Fly|Huawei|i-mate|iPAQ|iPhone|iPod|LG-|LGE-|MDS_|MOT-|Nokia|Palm|Panasonic|Pantech|Philips|Sagem|Samsung|Sharp|SIE-|Symbian|Vodafone|Voxtel|WebOS|Windows\s+CE|ZTE-|Zune).*$ [NC,OR]
    RewriteCond %{HTTP_ACCEPT} application/vnd.wap.xhtml\+xml [NC,OR]
    RewriteCond %{HTTP_ACCEPT} text/vnd.wap.wml [NC]
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    I'm guessing you mean the second one, so I'll try that and get back to you.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.