The MU forums have moved to WordPress.org

Image Upload Paths (11 posts)

  1. daki
    Member
    Posted 17 years ago #

    Hi

    and I've got the next problem.
    If i upload a picture it works perfectly, the file is on the server, but i i try to watch the picture in the browser i get a 404 error - not found.

    this is the path to the file, which is displayed in the browser.

    http://sub.domain.de/files/2006/04/aus_alt.thumbnail.jpg

    the file is in /wp-content/blogs.dir/##/files/2006/04/

    i think its only a litte problem with the rewrite rules.

    this is my .htacces file for rewrite..

    http://upload.blogd.de/nopaste/index.php?id=ddfa58f3be

    i'll be very nice if you can help me :)

    regards

    Stefan

  2. daki
    Member
    Posted 17 years ago #

  3. ergate
    Member
    Posted 17 years ago #

    There is another option to itdamagers htaccess. Not to put down his htaccess, it worked great for me to a point, the last time I upgraded the htaccess broke and I had to either fix it, or fix the one that is bundled with WPMU, I ended up fixing the bundled htaccess.
    Fixing the errors with the htaccess that comes with WPMU was fairly simple, I was having problems with
    1. Images
    2. Comments
    This was easily fixed,

    Images: add this line
    RewriteRule ^files/(.*) /wp-inst/wp-content/blogs.php?file=$1 [L]
    I added it right before this
    # rewrite these

    Comments:
    Find this
    # We want to pass these files straight through
    RewriteRule ^([_0-9a-zA-Z-]+)/wp-comments-post.php(.*) BASE/wp-inst/wp-comments-post.php [L]

    And change it to look like this.
    # We want to pass these files straight through
    RewriteRule ^wp-comments-post.php /wp-inst/wp-comments-post.php [L]

    Also, just an fyi, I managed to integrate Falbum with this htaccess, all that was needed was to add the falbum. First it needs to be near the top of the htaccess, in my example below I included the wpmu htaccess above and below the falbum stuff just to give an idea of where i placed it. You should also notice that /wp-inst/ was added into the falbum line, wont work without it, you will also notice that we called our falbum page "gallery" you can call it whatever you want when you set it up.
    htaccess looks like...

    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #Falbum
    RewriteRule ^gallery/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?$ /wp-inst/wp-content/plugins/falbum/wp/album.php?$1=$2&$3=$4&$5=$6&$7=$8 [QSA,L]

    ###
    #### blogs
    ###

    signing off

  4. samchng
    Member
    Posted 17 years ago #

    ergate, what problems were you having with your comments? So far no problem for me with the .htaccess you changed. Did you upgrade to the latest nightly? Thus causing .htaccess breaking down?

    Anyway, have a question. Can anyone tell me what is the $1 and $2 and $3? For example in this statement. /wp-inst/wp-content/blogs.php?file=$1 [L]

    Thanks!

  5. ergate
    Member
    Posted 17 years ago #

    The build I am using is from mid Feb. I am going to upgrade to the latest in a little while, I am hoping for a substantial update in the nightlies to occure then I will update.
    The problem I was having is similar to the one in this thread
    http://mu.wordpress.org/forums/topic.php?id=864 Basically, whenever I tried to do a comment it would give a 404. The addition I mentioned above fixed it.
    I dont know what it was about itdamagers htaccess that broke, but after I upgraded I started recieving not found problems, /wp-inst was stuck into the address of things not found.
    I think there was a fix for that posted, but I think that was lost in the restart.

    Also, I dont know what the variable mean. I was once given this address for reference but I havent really read it.
    http://www.w3central.com/apache/redirect-to-the-www-version/

  6. samchng
    Member
    Posted 17 years ago #

    Thanks for the quick reply. Will be upgrading soon too with something substantial. Still running on a nightly in late Feb.

  7. dbasulto
    Member
    Posted 17 years ago #

    I'm using the 2006-04-19 build, and when i upload files i can't see their thumbnails. If i send them to the editor, they get added like this:
    http://myblog/wpmu/ucinf/files/2006/04/clock.thumbnail.jpg
    The URL for it is:
    http://myblog/wpmu/wp-inst/wp-content/blogs.dir/2/files/2006/04/clock.thumbnail.jpg

    i tried changing my /wpmu/.htaccess as stated on this post, since the one given at http://www.itdamager.com/2005/12/10/wpmu-and-htaccess/ is for vhosts only, which i don't use.
    any way to fix this?

  8. vCarey
    Member
    Posted 17 years ago #

    ergate, thanks! That code is so sweet!

    I tried way back when to get images to work and nothing I tried worked. I gave up. Today I decided to try MU again. Did a fresh install. I was having problems with the images again -- and the comments (this time), too. Your code solved both problems! Oh so sweet!

  9. cgoerner
    Member
    Posted 17 years ago #

    dbasulto:
    This was giving me trouble too. I'm not using vhosts and my images were'nt showing up. With a little bit of experimenting, I changed a line in the .htaccess file:

    RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) /blogs/wp-inst/wp-content/blogs.php?file=$1 [L]

    to

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

    It fixed the problem for me.

  10. girish121
    Member
    Posted 17 years ago #

    Hi I installed wordpressmu recently. But the images on my post are not displayed. mY webserver iis 6.0 on windows 2003. The .htaccess is shown below. Also I can view the image with actual URL: http://debtweek.blogs.iva.co.uk/wp-content/blogs.dir/7/files/2007/01/iva_mediaclipping_thewharf110107_small2.jpg.

    blog Url where image is not displayed:- http://debtweek.blogs.iva.co.uk/

    ******************************************

    RewriteEngine On
    RewriteBase /

    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #uploaded files
    #RewriteRule ^(.*)/files/(.*) wp-content/blogs.php?file=$2 [L]
    RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
    #RewriteRule ^([_0-9a-zA-Z-]+)?/?files/(.*) wp-content/blogs.php?file=$2 [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]
    ****************************
    aprreciate your help

  11. girish121
    Member
    Posted 17 years ago #

    Also do we need to restart the server machine after modification to .htaccess or just restarting the iis is enough?

About this Topic