Support » Networking WordPress » File upload problem on subdomains

  • Resolved photosites

    (@photosites)


    Very new to this please bear with me! thanks! I am running 3.1.2 multisite on hostgator. My uploads to my main site are fine they go to
    mysite.com/wp-content/uploads/2011/04/image.jpg

    My uploads to my subdomains are not working! They are showing the file going to:
    sub1.mysite.com/files/2011/06/image.jpg
    as the link url. But the file is not there. And if I posted the pic in a page there is just an x.

    Here is one of the subdomains where this is happpening.
    http://mysite.bestnewbornphotographers.org/

    So my amature eyes see that the folder is /files/2011/06/ – is it suppose to be in the blogs.dir folder something like this:
    wp-content/blogs.dir/4/files

    Below is the rewrite code in htaccess.

    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]

    ANY HELP WOULD BE GREATLY appreciated! thanks in advance.
    Bill

Viewing 5 replies - 1 through 5 (of 5 total)
  • Your .htaccess looks correct for subdomains. I would recommend you ask Hostgator to make sure Apache is reading the file. And, yes, the URL to your subdomain images *should* be /files/2011/06/image.jpg; the .hataccess file hides the wp-content/blogs.dir part on purpose.

    Thread Starter photosites

    (@photosites)

    Thank you i will try that. Is that something specifc I should ask them for when creating a ticket other than letting them know whats happening?

    Thanks again.

    You can link them to this forum post and they should understand. Essentially, they need to look at the Apache configuration to make sure it is reading and processing the .htaccess file.

    Thread Starter photosites

    (@photosites)

    Thought i would post what i found. After hours of looking it had to do with htacces needing an extra line of code:

    RewriteRule ^([_0-9a-zA-Z-]+/)?blogN/files/(.+) wp-content/blogs.dir/N/files/$2 [L]

    Hope this helps others!!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    FYI, that SHOULD be handled by

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

    That it’s NOT is indicative of something being wrong on your server. Which is why Tim said you need to talk to your host.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘File upload problem on subdomains’ is closed to new replies.