• Resolved KWentin

    (@kwentin)


    hello again,

    i have successfully switched around 15 single wordpress blogs into one big multisite installation. everything went rather well, but now i noticed that the path for media changed from “wp-content/uploads/xxx” to “files/xxx”.

    this is not a problem as far as hardcoded references in post contents are concerned, i already updated this with a simple replace, the problem is deep links from other websites and search engines.

    if someone has a deep link to domain1.com/wp-content/uploads/2011/05/test.pdf i want this to be redirected to domain1.com/files/2011/05/test.pdf!

    i already found this post that said to use this:

    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1

    unfortunately, my problem is, that i have 15 different domains to be redirected to. if i use the “main”-blog url then the wordpress redirect still adds the site-id to the blog.dir folder:

    /wp-content/blogs.dir/1/files/2011/09/

    so this does not work with all the different sites.

    any help, what should I do to have a redirect that is working with all hostnames and site-ids?

    thanks, bye,
    kwentin

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

    (@ipstenu)

    ?????? Advisor and Activist

    Try this:

    RedirectMatch 301 /wp-content/uploads/(.*)$ /files/$1

    Failing that, you’ll need to do something like

    RewriteCond %{HTTP_HOST} ^domainfoo\.com
    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1
    Thread Starter KWentin

    (@kwentin)

    thank you once again ipstenu. i could almost swear i already tried it like that:

    RedirectMatch 301 /wp-content/uploads/(.*)$ /files/$1

    must have been a typo, i don’t know, but now it works, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘redirect rule wp-content/uploads to files for multisite’ is closed to new replies.