WordPress.org

Ready to get started?Download WordPress

Forums

Multisite images cannot be displayed in subsites (43 posts)

  1. progers
    Member
    Posted 2 years ago #

    Here is the error I am getting:

    The image "http://lincoln.playcreativeinc.com/files/2012/02/lincoln_footer_1.jpg" cannot be displayed because it contains errors.

    When I navigate to http://lincoln.playcreativeinc.com/wp-content/blogs.dir/3/files/2012/02/lincoln_footer_1.jpg the image shows up fine.

    When I use the media library for http://www.playcreativeinc.com images do not have this issue, only the subsites.

    Here is my .htaccess file:

    # 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

    After contacting Dreamhost here is what they say is in my httpd.conf file:

    AllowOverride AuthConfig FileInfo Indexes Limit
    Options=ExecCGI,Includes,Indexes,MultiViews,SymlinksIfOwnerMatch,FollowSymlinks

    To be clear I didn't set any of the options up in this file, but is it specifying too many options? Should I change it to AllowOverride FileInfo Options?

  2. leon4u
    Member
    Posted 2 years ago #

    You can just try to write this,
    AllowOverride ALL
    and clear other options.

    Before you do this, remember first backup your original httpd.conf file.

    Actually, I have the same problem like yours.

    Hope it can help you.

  3. progers
    Member
    Posted 2 years ago #

    After contacting Dreamhost they finally told me how to update httpd.conf. I updated the options to the following:

    <Directory /home/xxxxx>
    AllowOverride All
    </Directory>

    And the image still fails to load. I also tried AllowOverride FileInfo Options and that didn't seem to work either.

    I wonder if I should restart the web server and or wait a while after updating the httpd.conf for it to work.

  4. Yes, recycle apache after you change httpd.conf.

  5. progers
    Member
    Posted 2 years ago #

    I tried stopping and starting the web server after updating httpd.conf to:

    <Directory /home/xxxxx>
    AllowOverride All
    </Directory>

    and:

    <Directory /home/xxxxx>
    AllowOverride FileInfo Options
    </Directory>

    and the image still doesn't load. In the httpd.conf file I did notice this though:

    <Directory>
    AllowOverride None
    </Directory>
    ...
    <Directory /home/xxxxx>
    AllowOverride All
    </Directory>
    ...
    <Directory /home/xxxxx/playcreativeinc.com>
    AddHandler cgi-script .cgi .pl .py
    Options Includes Indexes SymLinksIfOwnerMatch ExecCGI
    ...large block of code
    </Directory>

    Should I change the empty directory at the top to AllowOverride All? Should I add AllowOverride All, (which doesn't seem to specify it right now), to the playcreativeinc.com directory?

  6. progers
    Member
    Posted 2 years ago #

    I was playing around with the settings and I tried AllowOverride All, AllowOverride FileInfo Options, AllowOverride FileInfo Options All in the empty directory, /home/xxxxx/, and /home/xxxxx/playcreativeinc.com and none of those configurations worked correctly.

    I restarted apache after each change as well.

    I also was reading around some other posts and thought my RewriteRule was incorrect in .htaccess so I tried to update it to:

    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    but that did not work either. So I reverted it back to:

    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

  7. Your .htaccess is correct for Subdomains. Is that what you're using?

  8. farahnaz783
    Member
    Posted 2 years ago #

    all information is correct and working nicely so thanks for providing it here

  9. progers
    Member
    Posted 2 years ago #

    Yes I'm using subdomains, here is what Network Setup says I should be using under Network Admin:

    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]
  10. Did the images work before you mapped domains?

  11. progers
    Member
    Posted 2 years ago #

    They work just fine in the admin site, just not the subsites.

    http://www.playcreativeinc.com - works correctly
    lincoln.playcreativeinc.com - does not work correctly

    I'm sorry for not understanding this but what do you mean before I mapped domains?

  12. Oh I don't know WHY I thought you were mapping domains. Sorry, I'm de-caffinated today.

    http://lincoln.playcreativeinc.com/files/2012/02/lincoln_footer_1.jpg is a BROKEN image...

    Do you have any hotlink protection turned on?

  13. progers
    Member
    Posted 2 years ago #

    Both .htaccess and httpd.conf do not contain any hotlink protection. Is there somewhere else this could be checked?

    I think the image itself is okay, when I use the directory structure to view the image it displays just fine:

    http://lincoln.playcreativeinc.com/wp-content/blogs.dir/3/files/2012/02/lincoln_footer_1.jpg

  14. Yes, but the SHORTER URL not working means there's a problem :)

    http://lincoln.playcreativeinc.com/wp-includes/ms-files.php?file=/2012/02/lincoln_footer_1.jpg

    doesn't work either. Does the server allow for cross subdomain data?

  15. progers
    Member
    Posted 2 years ago #

    I'm not sure about that, how do I check for that?

  16. Ask Dreamhost.

  17. progers
    Member
    Posted 2 years ago #

    Dreamhost says that there's nothing in general that should cause one domain to not load resources from another domain or subdomain. They also say that it can mean a number of different things, so they would really need a specific example of what you are looking for.

  18. .... Okay. THANK you Dreamhost for being as excellent at supporting WP as you claim to be. (Sorry, I'm snippy at them, not you.)

    http://lincoln.playcreativeinc.com/files/2012/02/lincoln_footer_1.jpg redirects via .htaccess to http://lincoln.playcreativeinc.com/wp-includes/ms-files.php?file=/2012/02/lincoln_footer_1.jpg

    http://lincoln.playcreativeinc.com/wp-includes/ms-files.php?file=/2012/02/lincoln_footer_1.jpg uses the ms-files.php code to extract blog info and pull http://lincoln.playcreativeinc.com/wp-content/blogs.dir/3/files/2012/02/lincoln_footer_1.jpg

    ONLY http://lincoln.playcreativeinc.com/wp-content/blogs.dir/3/files/2012/02/lincoln_footer_1.jpg works.

    That means the ms-files.php command isn't allowed to run.

    You can try re-uploading the whole wp-includes server from a fresh copy, but pointing out to dreamhost that the file, which works perfectly for thousands of people, is not working on your server may be what they need to understand.

    Are there any errors in your php error log?

  19. progers
    Member
    Posted 2 years ago #

    I will try to explain the situation better to them.

    Is there a way that I can test ms-files.php to determine what the actual problem is? Right now all I can do is assume that ms-files.php works, and that somehow the server is not set up correctly.

    And no there are no errors in my error.log file.

  20. I don't know of a way to test, sadly. Though if you have a post with images on the MAIN site that work, they too use the ms files usually. We could play with that?

  21. progers
    Member
    Posted 2 years ago #

    I have tested the main site's ability to display uploaded images via the media gallery and that works correctly.

    Maybe someone else knows a way to debug the ms-files.php code by walking through the request and seeing where things go wrong.

  22. What's a URL of an image that works on the main site?

  23. progers
    Member
    Posted 2 years ago #

    Here is an image that works on the main site:

    http://www.playcreativeinc.com/wp-content/uploads/2012/02/lincoln_footer_3.jpg

  24. http://www.playcreativeinc.com/wp-includes/ms-files.php?file=/2012/02/lincoln_footer_3.jpg does not work.

    So ... that ms-files.php isn't working.

    Did you turn off all your plugins?

  25. progers
    Member
    Posted 2 years ago #

    I don't have any plugins currently activated, they are all inactive.

    Does the main site even use ms-files.php? Or is that only for subsites? The reason I ask is because in the media library it uses the uploads directory rather than the blogs.dir directory for images.

  26. The main site doesn't use it out of the box, but it can (I forced mine to, just cause I'm a sicko). Something's not letting that file work it's magic.

    If all plugins are INactive, please rename the folder to plugins-old (there's a reason, it'll force everything to reload 'cleanly').

  27. progers
    Member
    Posted 2 years ago #

    Renamed plugins to plugins-old and now the inactive ones don't display listed under plugins. I tried logging in again to view the media library and the images still don't display correctly.

  28. Dreamhost....

    How did you install WP? Manually or via their one click installer?

  29. progers
    Member
    Posted 2 years ago #

    I installed WordPress via their one-click custom installer. Also I did remove the option to include all the free themes that normally come with the installation.

  30. Ugh. Their one-click will be the death of me.

    What's the Multisite section of your wp-config look like?

Topic Closed

This topic has been closed to new replies.

About this Topic