Forums

[resolved] .htaccess for child site uploads? (4 posts)

  1. spaceghost65
    Member
    Posted 3 months ago #

    Images are broken within the WP Media Gallery in child sites. All other data seems to be working fine. I can only see an uploaded image when i go to "edit" an image within the Media Gallery image editor, other than that it is only broken file placeholders.

    I believe it is an .htaccess problem.

    Example:

    File path:
    /var/www/wordpress/wp-content/blogs.dir/4/files/2013/01/image.png

    URL path:
    http://domain.com/test3/files/2013/01/image.png (gives a 404)

    Current rule in my .htaccess:

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

    Does anybody know what this should be?

    More Info:
    Fresh WordPress 3.5.1 from the admin panel
    All plug-ins deactivated
    Files upload fine, just can't see them via a browser
    File permissions right now on all folders and files:: 775
    Default Twenty Twelve theme
    Only 1 child site in my network
    Media Gallery seems to work fine in the main site, just not the child site.

    Thanks everyone, any help or advice is really appreciated.

  2. spaceghost65
    Member
    Posted 3 months ago #

    Found my issue and I cant believe this, obviously this is just for me and might not work for you.

    the was a space in the Rewrite rule that needed to be inserted.:

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

    Needs to be

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

    Whacky I know. Hope this helps somebody out there.

  3. fuzzie
    Member
    Posted 3 months ago #

    I wish that fixed mine...
    My rule was already
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

  4. fuzzie
    Member
    Posted 3 months ago #

    I figured out my issue:
    I had this in my htaccess
    RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://mydomain.com/$4
    to fix permalinks.

    I had found that here: http://www.webanddesigners.com/20-htaccess-hacks-to-prevent-your-wordpress-site-from-hacking/

    Now to see if anything else broke.

Reply

You must log in to post.

About this Topic