The MU forums have moved to

Image Upload Paths (11 posts)

  1. daki
    Posted 18 years ago #


    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.

    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..

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



  2. daki
    Posted 18 years ago #

  3. ergate
    Posted 18 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
    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

    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 to
    RewriteCond %{HTTP_HOST} ^www.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    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
    Posted 18 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]


  5. ergate
    Posted 18 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 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.

  6. samchng
    Posted 18 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
    Posted 18 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:
    The URL for it is:

    i tried changing my /wpmu/.htaccess as stated on this post, since the one given at is for vhosts only, which i don't use.
    any way to fix this?

  8. vCarey
    Posted 18 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
    Posted 18 years ago #

    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]


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

    It fixed the problem for me.

  10. girish121
    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:

    blog Url where image is not displayed:-


    RewriteEngine On
    RewriteBase /

    # Rewrite to
    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
    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