Support » Networking WordPress » Images are not uploading into correct file

Viewing 15 replies - 1 through 15 (of 42 total)
  • It’s 100% to do with the ,htaccess file and mod_rewrite. They are going to the right spot, where they are supposed to on the server. the rewrite rule is either not being read correctly, isn’t in there right, or mod_rewrite is failing to read the file.

    this is the rule:

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

    It has to be there. When you set up the network, the htaccess rules that are given are to *replace* the ones you had, not be added at the end of the file. Make sure you did that.

    Thank you for responding. I know nothing about this stuff, and you were working “blind”. I tried and failed. Below are the before and after htaccess files. Can you take a look and tell me what I’m doing wrong please?

    BEFORE

    # BEGIN WordPress
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.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-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    AFTER “my interpretation of your suggestion”
    # BEGIN WordPress

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.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-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Corrected .htaccess for ya!

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Try that and see if it works.

    Thank you for the rapid response. Still no success.

    Interesting.

    http://devsite103.com/wp-includes/ms-files.php?file=/2010/06/meeting2.jpg gives a 404 as well.

    Are you using domain redirects or just subdomains for your site?

    Just sub-domains for now. I’m planning on changing to domain redirects after the site is complete and functional. Thank you so much for helping.

    I would be happy to give you access as admin if it would help you to find the problem. Email me chuck@cybersearch-us.com.

    Wouldn’t help 🙂

    Can you check, on FTP, if the ms-files.php file exists in the wp-includes folder?

    Yes, it’s there. Thanks

    Okay, back to basics. Turn off your plugins! 🙂

    Ok. I’ve turned deactivated them all. No change. Tried adding a photo and while the space is there, the photo isn’t.

    EXAMPLE – http://cooking.thefrazzledmama.com/files/2010/08/ezmuffins11.jpg
    NO LOAD – http://tbfaa.devsite103.com/files/2010/06/meeting.jpg

    These are on the same server and network setup, right?

    You don’t have any weird hotline protection setup, do you?

    Yes, both on the same server and network. I don’t know what a “hotline protection setup” is, but I don’t think I have one.

    I think I am experiencing a similar problem. When I add an image to the native Gallery, it places this code in the post:

    <img src=”http://mywebsite.org/files/2010/09/grand-prix-large-300×185.jpg/grand-prix-large-300×185.jpg” alt=”” width=”300″ height=”185″ class=”aligncenter size-medium wp-image-383″ />

    BUT, the image is not located there. It is located at this address:

    <img src=”http://mywebsite.org/wp-content/blogs.dir/2/files/2010/09/grand-prix-large-300×185.jpg” alt=”” width=”300″ height=”185″ class=”aligncenter size-medium wp-image-383″ />

    That is not a problem, that’s what WordPress is supposed to do.
    It not showing is the issue – which is entirely to do with the .htaccess file and your server reading it.

Viewing 15 replies - 1 through 15 (of 42 total)
  • The topic ‘Images are not uploading into correct file’ is closed to new replies.