WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Images 'broken' in WP multisite (27 posts)

  1. yspeert
    Member
    Posted 2 years ago #

    Hey guys,

    Just installed my first WP network site. A mother with three daughters.

    The images in the mother work fine, appear in the media library etc.

    However, not so in the daughters, all media appear as broken images.

    Any idea how to fix this? Is this htaccess setting?

    Thanks,
    Arjan

  2. jtt89
    Member
    Posted 2 years ago #

    Try this one:

    http://wordpress.org/support/topic/images-no-appearing-on-a-site?replies=4

    (I recommend writing down what you are doing step by step, so you can go back to the originlal settings if you need to)

    Also, there is a lot of posts on this topic. Try Google too.

  3. arun nair
    Member
    Posted 2 years ago #

    1.Go to Super Admin > Sites, hover over the primary blog and click Edit
    2.Change "Upload Path" to wp-content/blogs.dir/1/files (this one was: wp-content/uploads)
    3.Change "Upload Url Path" to /files (this one was empty)
    4.Change "Fileupload Url" to http://domain.com/files (this one was: http://domain-name.com/wp-content/uploads)

    [removed spam]

  4. arun nair - Please don't promote your business here. Also DO NOT CHANGE THE UPLOAD PATH.

    Gosh, people, this stuff can and does work out of the box. Screwing around with settings, when you don't know what you're doing, will cause more problems!

    Now. Stop. Breathe :) It's all okay.

    1) Yes, it can be a .htaccess thing. Double check yours is okay.

    2) It's more often a httpd.conf thing. Check that yours has allowoverride set to all (if you don't know how, ask your webhost).

  5. yspeert
    Member
    Posted 2 years ago #

    Breathing, stopping....

    My htaccess text:

    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]

    And the httpd.conf has been checked with my provider, allowoverride is indeed set to all, so no problem there...

    So is it the htaccess??

    Thanks!

    Arjan

  6. Are you using subdomains or subfolders for your sites?

    That is are the urls mother.com/daughter1 or daughter1.mother.com ?

  7. yspeert
    Member
    Posted 2 years ago #

    Subdomains.

  8. That's the right one.

    Okay we'll have to experiment a little here.

    Assuming a broken image is daughter1.mother.com/files/2012/06/image.jpg

    WHat happens if you go to daughter1.mother.com/wp-includes/ms-files.php?file=2012/06/image.jpg

  9. yspeert
    Member
    Posted 2 years ago #

    Current path for a picture is e.g.:

    http://erfrecht.groningen-notaris.com/files/2012/06/A-notaris-testament-en-erfrecht.jpg
    (broken links)

    When I use:

    http://erfrecht.groningen-notaris.com/wp-includes/ms-files.php?file=2012/06/A-notaris-testament-en-erfrecht.jpg

    The picture actually appears in my browser... So that is good news I hope?

    Cheers,
    Arjan

  10. Yes and no. It means that your .htaccess isn't being respected :/ Which is usually what that httpd.conf setting is all about.

    What's your AllowOverride set to?

  11. TCBarrett
    Member
    Posted 2 years ago #

    Long shot: Have you changed the domain name under network admin?

    (as super admin) network admin > sites > edit [site] > domain

  12. Which is the wrong way to do it... So I really hope you didn't!

  13. TCBarrett
    Member
    Posted 2 years ago #

    Erm, yes. I should have clarified that. That's the wrong way to do domain mapping! As wisely pointed out above; don't do this. But undo it if you have.

    Domain mapping with sunrise is under Tools > Domain Mapping

  14. yspeert
    Member
    Posted 2 years ago #

    Hey guys,

    Thank for all the input.

    AllowOverride was indeed set to all.

    I have not changed the domain name for the mother, but I have changed them for the daughters. E.g. the daughter erfrecht.groningen-notaris.com is mapped to a more userfriendly domain name; http://www.notaris-erfrecht.com

    Cheers,

    Arjan

  15. Mapped how? You used a plugin, right?

    Did they work before you mapped?

  16. yspeert
    Member
    Posted 2 years ago #

    Yes,

    I use: WordPress MU Domain Mapping

    As we started the network we installed Domain Mapping before doing anything else, so did not try to change the header. So I don't know if they worked before...

    Cheers,

    Arjan

  17. Well... Okay. Make a test site and see if they work there.

    What I want to see is if we can narrow it down to the install or a plugin ;)

  18. yspeert
    Member
    Posted 2 years ago #

    Made testsite (no plugins),

    uploaded picture to library.... broken.

    uploaded picture for header.... broken.

  19. Right :) It's not domain mapping, excellent.

    Can you find out exactly what your AllowOverride is set to?

    It may need to be AllowOverride Fileinfo Options All

    Yeah, I know. Show your host this: http://codex.wordpress.org/Multisite_Network_Administration#Apache_Virtual_Hosts_and_Mod_Rewrite

  20. yspeert
    Member
    Posted 2 years ago #

    This is what the hosting party sends me, a logfile with what happens (see below).

    They feel that WordPress tries to write in /var/www/notaris-hypotheek.nl/web/files while it should write/read in:
    /var/www/notaris-hypotheek.nl/web/wp-content/blogs.dir/$id/files.

    logfile:

    [Fri Jul 06 15:34:48 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:34:49 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:37:41 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:37:54 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:37:54 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:37:55 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:38:00 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://www.notaris-erfrecht.com/
    [Fri Jul 06 15:38:14 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=2
    [Fri Jul 06 15:38:14 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=2
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3
    [Fri Jul 06 15:38:17 2012] [error] [client 89.200.200.5] File does not exist: /var/www/notaris-hypotheek.nl/web/files, referer: http://erfrecht.groningen-notaris.com/wp-admin/themes.php?page=custom-header&step=3

  21. yspeert
    Member
    Posted 2 years ago #

    sorry, pressed send too many times

  22. S'okay :)

    Okay, your host is kind of right.

    See this line from your .htaccess?
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    That's what says /files is really wp-content/blogs.dir/$id/files

    So what's happening here is your server isn't reading that file.

    That this worked: http://erfrecht.groningen-notaris.com/wp-includes/ms-files.php?file=2012/06/A-notaris-testament-en-erfrecht.jpg

    means that the line isn't being read at all, Which is why I asked about allowoverride. That's what controlls that.

    So tell your host this

    "WordPress is using a complex .htaccess redirect to take /files, pass it through wp-includes/ms-files.php and then to my /wp-content/blogs.dir. The ms-files.php file works fine, but the .htaccess isn't being read to pass to that file. Is there something on my server that would prevent it from being read? The documentation says that generally happens if AllowOverride isn't set to All for my vhost."

  23. h20ray
    Member
    Posted 2 years ago #

    i've got this problem..
    http://test.ibcfm.com/files/2012/07/unimus.jpg is not showing..

    then i try

    thttp://test.ibcfm.com/wp-includes/ms-files.php?file=2012/07/unimus.jpg

    still not showing..

    is this from my host?

  24. h20ray - if your .htaccess is correct, then yes, it's something on the server that isnt reading that .htaccess and translating it. Generally that's caused by AllowOverride not being set to All.

  25. yspeert
    Member
    Posted 2 years ago #

    Hey guys,

    The problem is solved (thanks to all but especially to Mika), my hostingparty found the problem in the end.

    They say:

    It turned out the htaccess file I uploaded had the wrong name (htaccess.rtf) and contained metadata (whatever that is) because I used a texteditor (the one you'll find on your Mac).

    Anyway, alls well that ends well, I am so happy that my pictures are now showing.

    Thank you all, really appreciate it. Anyone in Edinburgh coming weekend? I'll buy you a beer.

    Cheers,

    Arjan

  26. p0ps
    Member
    Posted 2 years ago #

    I'm having the same problem. I see that my .htaccess does not have the rewrite rule that Mika asked you to look for on yours, yspeert.

    Should I add
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    to mine?
    Presently mine only says:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

  27. p0ps - Ooooowwwwwn tooppppiiccccc

    There's a reason I nag y'all to make your own topic: It's easier to help you if we don't have to talk to 7 people at once. So please. Make your own topic, especially since yspeert's problem is resolved :)

Topic Closed

This topic has been closed to new replies.

About this Topic