WordPress.org

Support

Support » Multisite » [Resolved] Can I create an 'images' folder for a subdomain multisite?

[Resolved] Can I create an 'images' folder for a subdomain multisite?

  • mydog8it

    @mydog8it

    I’m moving a site that was on its own install to a subdomain multisite install with domain mapping. Problem is, the site used to be in html and all of the old images are in a mydomain.com/images folder, and the posts link to them there.

    I’ve tried adding an images folder here: /wp-content/blogs.dir/2/images

    and here: /wp-content/blogs.dir/2/files/images

    but when I go to mydomain.com/images, it doesn’t exist. Is it possible to do this with a multisite install? Where do I put the folder?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    @ipstenu

    Keep them in /wp-content/blogs.dir/2/images and do this:

    RewriteRule ^images/(.*)$ /wp-content/blogs.dir/2/images/$1 [L,R=301]

    Put that above your WordPress htaccess rules 😀

    mydog8it

    @mydog8it

    Thanks!! yay. This worked great.

    But…I also have an images folder in my main site, and it’s redirecting those into the other site’s folder now. I’m not super familiar with htaccess files. Can I just change it to the specific domain, like this?

    RewriteRule ^mydomain.com/images/(.*)$ /wp-content/blogs.dir/2/images/$1 [L,R=301]

    or do I need to get rid of the ^

    RewriteRule mydomain.com/images/(.*)$ /wp-content/blogs.dir/2/images/$1 [L,R=301]

    I don’t want to try random things and blow up the internet.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    Close!

    # MyDomain Images
    RewriteCond %{HTTP_HOST} ^mydomain\.com
    RewriteRule ^images/(.*)$ /wp-content/blogs.dir/2/images/$1 [L,R=301]

    The RrewriteCond is only good for one line, so if you want to also redirect mydomain.com/rainbows to mydomain.com/wp-content/blogs.dir/2/rainbows it works like this:

    # MyDomain Redirects
    RewriteCond %{HTTP_HOST} ^mydomain\.com
    RewriteRule ^images/(.*)$ /wp-content/blogs.dir/2/images/$1 [L,R=301]
    RewriteCond %{HTTP_HOST} ^mydomain\.com
    RewriteRule ^rainbows/(.*)$ /wp-content/blogs.dir/2/rainbows/$1 [L,R=301]
    mydog8it

    @mydog8it

    Works perfectly! Thank you so much. You saved me days of work. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Can I create an 'images' folder for a subdomain multisite?’ is closed to new replies.
Skip to toolbar