The MU forums have moved to WordPress.org

Uploaded images path goes wrong (22 posts)

  1. gerbiloz
    Member
    Posted 15 years ago #

    I have this wierd problem with my Media Library in 2.6.5 WP MU.

    After i upload any image, the link to it seems to be broken! Insteed of '/wp-content/blogs.dir/1/files/2009/01/my_file.jpg' i got '/files/2009/01/my_file.jpg'.. so '/wp-content/blogs.dir/1/' is missing..

    How should i change this upload path? Or change some lines in .htaccess?

  2. andrea_r
    Moderator
    Posted 15 years ago #

    /wp-content/blogs.dir/1/files/2009/01/my_file.jpg

    is where it will physically be stored on the server.

    /files/2009/01/my_file.jpg

    is where the htaccess will rewrite it for display.

    it works like this by default. if for some reason, the images aren't showing, then you have a different issue.

  3. gerbiloz
    Member
    Posted 15 years ago #

    yeap, images in Media Library aren't showing.. but physically there are on server.. so what's you thoughts this might be?

  4. andrea_r
    Moderator
    Posted 15 years ago #

    Did you mess with the htaccess file that was created on install?

    Are you on IIS or using Ngix?

  5. gerbiloz
    Member
    Posted 15 years ago #

    andrea_r, nope. i didn't touch this file ever. and i'm on System Linux alpha 2.6.26-1-amd64 #1 SMP Mon Dec 15 17:25:36 UTC 2008 x86_64 (http://tf2.lv/wp-content/tmp/phpinfo.php)

  6. gerbiloz
    Member
    Posted 15 years ago #

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    --

    This is it.

  7. andrea_r
    Moderator
    Posted 15 years ago #

    Yeah, that's the default. I can pretty much recite it from memory at this point, no need to paste it in. :)

    So, you upload an image, put it in a post, and then what happens?

  8. gerbiloz
    Member
    Posted 15 years ago #

    hehe )) so i upload some file and in media library i get 'no image' in thumbnails, cause path to my uploaded file is without '/wp-content/blogs.dir/1/'. and in my post i get 'http://tf2.lv//files/2009/01/my_file.jpg' - that is wrong, insteed of correct - 'http://tf2.lv/wp-content/blogs.dir/1/files/2009/01/my_file.jpg'

  9. cafespain
    Member
    Posted 15 years ago #

    if you put http://tf2.lv/files/2009/01/my_file.jpg in a browser window, what do you get?

  10. gerbiloz
    Member
    Posted 15 years ago #

    nothing.. 404 page

  11. cafespain
    Member
    Posted 15 years ago #

    Hmmm. I've had this before, but can't for the life of me remember what I did...

    Check the permissions on your blogs.dir directory and make sure that you have a blogs.php file in the wp-content directory.

    Then try entering:
    http://tf2.lv/wp-content/blogs.php?file=/2009/01/my_file.jpg

    In the browser and see what happens.

  12. gerbiloz
    Member
    Posted 15 years ago #

    /blogs.dir/ - chmod 770 and i have blogs.php in /wp-content/.

    And such link 'http://tf2.lv/wp-content/blogs.php?file=/2009/01/fog.jpg' - is working like a charm!

    So what should i update to see thumbnails in my Media Library? )

  13. cafespain
    Member
    Posted 15 years ago #

    If that link is working, then it looks like something is up with your htaccess after all. As all the top part does is take the URL and reformat it to the link that seems to be working.

  14. cafespain
    Member
    Posted 15 years ago #

    Try stripping down you .htaccess to the bare minimum - then add each bit and test, there maybe something in there that is messing things up.

    Start at the top and work your way down and test the files/ url with each edit.

  15. gerbiloz
    Member
    Posted 15 years ago #

    hm.. nothing worked out.. nothing in this file is messing things up, just line 'RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]' not working as it should.. i think

  16. andrea_r
    Moderator
    Posted 15 years ago #

    I'm thinking something is up with his GD library on the server. The image is fine, the thumbnails aren't being created. That points to thumbnail creation.

  17. gerbiloz
    Member
    Posted 15 years ago #

  18. vinayhk
    Member
    Posted 15 years ago #

    Hi,
    Even i am facing same problem, can u suggest some tips to solve this.

  19. peterlandt
    Member
    Posted 14 years ago #

    gerbiloz, did you ever find a solution to this problem? I am having the same exact issue without any luck.

  20. hummy.org
    Member
    Posted 14 years ago #

    Hello.
    I was facing exactly the same problem, until I check Apache's configuration.

    I had the directive:
    AllowOverride None
    So I changed it to:
    AllowOverride All

    Now Apache is loading wordpress' .htaccess configuration and the images are working correctly

    Cheers.
    Mario.

  21. irwnsyh
    Member
    Posted 14 years ago #

    same problem on me. I have read much topic at this forum n zero result. I was frustation. But, finally I am succes with this way.
    I try install wp-mu 2.6 first and then follow Upgrading WPMU at http://codex.wordpress.org/Upgrading_WPMU.
    it's worked for me and have no problem with uploding image.

  22. essay
    Member
    Posted 14 years ago #

    i have similar problem .. im really looking for any website that can help me fix it..

About this Topic