WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] .htaccess redirect weirdness from blogs.dir/#/files (3 posts)

  1. WStringer2
    Member
    Posted 1 year ago #

    I have a fully functioning WPMU instance running a few sites using the sub-folder method. The .htaccess file in /var/www/html is configured per the WP codex and is working fine. I have also confirmed that "AllowOverride" is set to All.

    On one of my sites, I want to redirect a sub-folder of the "files" directory to the Amazon S3. I've added an .htaccess file to:
    wp-content/blogs.dir/5/files/2011 to handle the redirect.

    If I visit an image directly it works, the redirect fires and the image is served from the S3:
    server/wp-content/blogs.dir/5/files/2011/10/image.jpg

    However, if I access the same image using the standard WPMU convention, it fails:
    server/sitename/files/2011/10/image.jpg

    Does this have to do with "chaining" .htaccess redirects? Any suggestions would be greatly appreciated!

  2. No, it has to do with WordPress's .htaccess.

    Since you're using subfolders, you should add in a redirect rule to the MAIN .htaccess, above the WordPress calls.

    if ^sitename/files/2011/*
    then S3

  3. WStringer2
    Member
    Posted 1 year ago #

    Worked like a charm...thanks Ipstenu!

Topic Closed

This topic has been closed to new replies.

About this Topic