The MU forums have moved to WordPress.org

Upload problems - maybe htaccess (9 posts)

  1. fradal
    Member
    Posted 16 years ago #

    Hello,
    I've just installed the latest version of Wordpress MU and everything was working good (after some cpanel related problems solved reading here - thank you!)

    Now I'm having this problem:
    When i try to upload a file through the "Write" editor, the file is uploaded but I cannot see it nor in the editor nor directly pointing to the url where the file is.

    I think it's ah .htaccess problem because the file is uploaded but it is not viewable.

    I've also noticed that for the first blogs the upload path was (example) blogs.dir/BLOGID/file/image.jpg while for the last blogs the path is blogs.dir/BLOGID/file/YYYY/MM/image.jpg

    Even if I try to upload an image on one of the first blogs I cannot see it (404 error).

    Now, I cannot see any hosted image in any blog!

    This is the .htaccess content:
    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?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]

    Blogs are running in subdomains.

    Thank you very much for your help!

  2. theapparatus
    Member
    Posted 16 years ago #

    Just a quick note that the readme file contains a link to the debugging script. While you give some good information here, you skip over the two most important things: checking your error logs and providing a link so others can actually see what is occuring.

    As to the htaccess file, that's the same file for everybody and shouldn't be coming into play.

  3. fradal
    Member
    Posted 16 years ago #

    You're right theapparatus, thank you for the note.

    Here's the answer to all the question of that link:
    1. VHOST is set to yes
    2. Mu has been installed on the main directory
    3. In the error_log file there's all the subdomains creation in this way: [06-Nov-2007 17:00:48] install_blog - ID: 3 URL: http://support.adultblogpress.com/ Title: For HostForWeb support
    4. No errors in the browser
    5. Does the information in wp_blogs, wp_users and wp_site match your blog, user and site? Yes
    6. Version 1.3
    7. All the plugins has been turned off
    8. Running Apache, no proxy or cache server
    9. Tried on sveral browsers/SO
    10. The error is fully explained in the first message

    I was thinking there was an htaccess problem because the url set in wp_posts seems right and the file is there.
    For example, I've just tried to upload an image and this is the url given:
    http://support.adultblogpress.com/files/estrattore.thumbnail.jpg
    As you can see there's a 404 error.
    The file is in wp-content/blogs.dir/3/files/estrattore.thumbnail.jpg

    Please ask if you need further information

    Thank you very much
    Francesco

  4. levi.putna
    Member
    Posted 15 years ago #

    Would it be possible to post the solution to your problem? I have been struggling to fix it for the past two weeks with no luck.

    This is the actual path to an image I uploaded http://clubsdotcom.com/files/2008/06/law-ball-015a21-150x150.jpghttp://clubsdotcom.com/wp-content/blogs.dir/1/files/2008/06/law-ball-015a21-150x150.jpg
    '
    This is the url that wordpress generated http://clubsdotcom.com/files/2008/06/law-ball-015a21-150x150.jpg

    if I remove these two lines from my .htaccess file I can view the image using the actual image path.

    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    This is my actual .htaccess

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    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>

    Please I need all the help i can get.

    Thanks,
    Levi

  5. charlievaughan
    Member
    Posted 15 years ago #

    I've been having the same problem as this and fixed it. I just copied a few lines:

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    from Levi's file that I was missing and added to my file:

    # BEGIN WordPress
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    <code><IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Ta daaaa!

  6. trebor79
    Member
    Posted 15 years ago #

    I was having similar problems with .htaccess affecting being able to use the flash file uploader (2.5 and 2.6).

    I have my WordPress MU installed in a subdirectory and the WordPress .htaccess file isn't giving me troubles, but the one on my main domain is.

    I have all robots/spiders and 'highly suspect' (faked) browsers blocked by default (bad_pass). I have added in Google, Yahoo!, etc back in (good_pass) like so:

    <Limit GET POST PUT HEAD>
    order allow,deny
    allow from env=good_pass
    deny from env=bad_pass
    </Limit>
    #allow Firefox, MSIE, Opera
    SetEnvIfNoCase User-agent "AOL" good_pass
    SetEnvIfNoCase User-agent "Mozilla" good_pass
    ...
    
    # allow Google
    SetEnvIfNoCase User-agent "Google" good_pass
    
    # deny spammers
    SetEnvIfNoCase User-agent "kastaneta" bad_pass
    ...

    Anyone know how to add WordPress to the .htaccess file so file upload works again? I don't want to disable the whole file. (The ... just means it's been cut out)

  7. gerbiloz
    Member
    Posted 15 years ago #

    guys, could anyone post solution for MU 2.6.5, cause i have exaclty the same problem as levi.putna or fradal...

  8. VentureMaker
    Member
    Posted 15 years ago #

    I think flash file uploader has nothing to do with WPMU, but with Flash10.

  9. gerbiloz
    Member
    Posted 15 years ago #

    yeap, that's true. but what about non showing thumbnails in media library?

About this Topic