Forums

[resolved] File upload problem on subdomains (6 posts)

  1. photosites
    Member
    Posted 11 months ago #

    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

  2. Tim Moore
    Code Wrangler
    Posted 11 months ago #

    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.

  3. photosites
    Member
    Posted 11 months ago #

    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.

  4. Tim Moore
    Code Wrangler
    Posted 11 months ago #

    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.

  5. photosites
    Member
    Posted 11 months ago #

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

  6. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 11 months ago #

    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.

Reply

You must log in to post.

About this Topic