WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Image upload problems for multisite subdomain site (6 posts)

  1. kpolkson
    Member
    Posted 2 years ago #

    Summary:
    I have just recently started multi-site for a work-related website so that the main page could be branched off into a staff blog (using this guide http://codex.wordpress.org/Create_A_Network ). So a subdomain is being used through BlueHost to have blog.domain.org where the original is, of course, domain.org.

    The problem is that I can upload images to the new blog site, but inserting them into posts is not working, it just shows the image link broken.

    I've already read through this post, which most mirrors the problem I am having:

    http://wordpress.org/support/topic/multisite-image-path-error?replies=37

    (as noted by user in the Ipstenu in that thread, this is an unfortunate case of a large established site going to multisite)

    It turns out the problem in that thread was a cache plugin, which I do not have, so I don't think that's it.

    Details:
    So after creating a blogs.dir folder, as suggested, things got messed up.

    In the file system, it looks like the images are being uploaded to /wp-content/blogs.dir/2/files/

    But when they are uploaded, it says that are at blog.domain.org/files/$year/$month/sampleimage.jpg

    I've changed the upload path to: wp-content/blogs.dir/2/files
    and the Fileuploadurl to: http://domain.org/wp-content/blogs.dir/2/files/ & then http://blog.domain.org/wp-content/blogs.dir/2/files/

    Nothing is working, I've also tried some of the things mentioned in the above mentioned thread like adding: RewriteRule ^files/(.*)$ http://domain.com/wp-content/files/$1 [L,R=301] to the .htaccess file.

    By the way, the .htaccess file currently looks like this since I know someone will ask to see that:

    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    
    # END WordPress

    Any help would be appreciated. I'm throwing my hands up in frustration. thanks in advance.

  2. In the file system, it looks like the images are being uploaded to /wp-content/blogs.dir/2/files/

    But when they are uploaded, it says that are at blog.domain.org/files/$year/$month/sampleimage.jpg

    Yes, that's correct and exactly what it's supposed to do.

    UNDO what you did.

    See this bit?

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    That says 'Anyone who comes to whatever.com/files/(anything) gets redirected to whatever.com/wp-includes/ms-files.php?file=(anything) which THEN redirects to whatever.com/wp-content/blogs.dir/2/files/(anything)'

    It really us supposed to do that, don't get flustered :) And above all DO NOT mess with it. It works, and if you don't understand how then just leave it alone.

    The problem is that I can upload images to the new blog site, but inserting them into posts is not working, it just shows the image link broken.

    Back to this. Your .htaccess isn't parsing things correctly.

    First problem is you have the WordPress calls in there twice. Your .htaccess should be this:

    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    
    # END WordPress

    Second up is that you need to check with BlueHost and ask if AllowOverride is set to ALL for your account.

  3. kpolkson
    Member
    Posted 2 years ago #

    Ok, I think that was the correction I needed. Images look like they are coming through now from the post edit to the final site view.

    Thanks so! much!

    For future lurkers, I'll say that I changed my upload path and Fileupload url (in Network Admin>Site>Edit>Settings) back to default:

    /wp-content/blogs.dir/2/files/ (or whatever #, doesn't have to be 2)
    &
    http://blog.domain.org/files/

    respectively.

    Then I edited my .htaccess file as you had it above. No need to edit the apache default to AllowOverride (phew).

    thanks again.

  4. It's ma'am, but no worries :D

    The 2 is because this is site #2. If you make another site, it'll be 3 and so on and so forth ;)

  5. kpolkson
    Member
    Posted 2 years ago #

    Sorry, it was the hat...

    thanks again.

  6. As I said, no worries ;) I get that a lot

Topic Closed

This topic has been closed to new replies.

About this Topic