WordPress.org

Support

Support » Multisite » [Resolved] Subdomain blogs uploads images correctly, but path written incorrectly

[Resolved] Subdomain blogs uploads images correctly, but path written incorrectly

  • When I upload images to the main site media gallery, it uploads and writes the path correct, but all subdomain blogs, upload to their correct wp-content/blogs.dir/#/files/date/ directory, but the subdomain name, doesn’t point to root/wp-content/blogs.dir/ – it seems to just put subdomain.root.com/files/date/ instead of rewriting correctly, which when you link it, takes you to a 404

    Example:
    http://test.legacycentered.com/
    Image upload written path:
    http://test.legacycentered.com/files/2012/10/bgforlegacy2.jpg
    Where the image appears it should be (but it is showing in cPanel File Manager in public_html):
    http://legacycentered.com/wp-content/blogs.dir/7/files/2012/10/bgforlegacy2.jpg

    I am on Hostgator, and my wildcard is set up correctly, I am 99% sure it’s the htaccess file, but can’t figure out how to fix it.

    htaccess
    ———–
    # BEGIN WPSuperCache
    # END WPSuperCache

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

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

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    </IfModule>

    # END WordPress

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Fixed! Hostgator support staff had an extra htaccess example file and replaced it. I was missing the wp-admin calls.

    If anyone else has this issue, this is what they gave me:

    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]

    HTH someone else!

    Forgot to mark as resolved…

    Solved the problem for me (after 36hrs of navigating and reading other stuff)

    Thank you so much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Subdomain blogs uploads images correctly, but path written incorrectly’ is closed to new replies.
Skip to toolbar