• In multisite upload paths are like:
    sub.domain.com/wp-content/uploads/sites/{blogid}/{date}/file
    I want it to be:
    sub.domain.com/{date}/file
    I see that it’s how upload paths are in wordpress.com.
    Is there a way to do that for example via rewrite rules?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can do this through wp-config.php

    Check this tutorial from WPBeginner.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    That won’t work (fully) on Multisite, and its pretty complicated.

    Why do you want to change it?

    Thread Starter WebNashr

    (@webnashr)

    That way (the default one) is so armature and using it, it’s apparent that the site is in a multisite and even the site id is shown. It’s not very desirable especially when using domain mapping.

    Thread Starter WebNashr

    (@webnashr)

    amateur (ridiculous autocomplete 🙂 )
    @andy I don’t want to change the upload path I want to do it via rewrites if possible.

    Hi,

    On Network Admin screen go to Sites -> All Sites, pick Edit on a website, go to Settings tab and:

    1. Set Uploads Use Yearmonth Folders to 1

    2. Use Upload Path and Upload Url Path to define the media paths you need for each site.

    Edit: forgot to mention that the new path won’t apply to old files, you may need to move the old files and use a search/replace tool on the DB to update the old URLs.

    Thread Starter WebNashr

    (@webnashr)

    As I said I don’t want to change the path because links to old files will become broken.
    Is there any existing plugin or .htaccess code to rewrite paths from:
    sub.domain.com/wp-content/uploads/sites/{blogid}/{date}/file
    to
    sub.domain.com/{date}/file
    or: sub.domain.com/{blogid}/{date}/file

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Yes and no…

    That way (the default one) is so armature and using it, it’s apparent that the site is in a multisite and even the site id is shown. It’s not very desirable especially when using domain mapping.

    Amaturish is the word you were looking for, and frankly, it’ll take me about 2 minutes to suss out you’re on multisite anyway. If someone’s looking, they’re gonna know, and it doesn’t matter any more than it does that my local CBS affiliate is on WP.COM

    Here’s the problem with your idea. We used to do that. It was problematic to put it mildly.

    http://halfelf.org/2012/dumping-ms-files/

    That’s how we got rid of it. How you’d put it BACK? Well… you’d have to start by reverse engineering the code, but really it involves both a .htaccess change AND the ms-files.php AND some DB shenanigans.

    Oh and you’ll possibly have to edit your post content… not sure. The old ones SHOULD still work, but since your’e going to be going from what USED to be wp-content/blogs.dir to wp-content/uploads, there will be some rewriting involved 🙁

    You’ll have to fork ms-files.php to boot.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘upload paths like WordPress.com’ is closed to new replies.