Support » Networking WordPress » Looking for file URL rewriting best practices (trying to emulate pre-3.5 style)

  • Resolved maiki


    I’ve been running a multisite instance since before 3.5, so the new uploads and URL structure caught me by surprise when I set up a new network.

    I’ve been poking around for a few hours, and all the docs and posts talking about moving directories around and whatnot. I am interested in creating custom file URLs, either network-wide or per-site, in the style of pre-3.5 instances.

    An example: =>

    Are there acceptable or popular ways to do this that I am not aware of? Your advice is appreciated. ^_^

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can change the upload path on a site by site basis in the network admin. Go to your site list in the network and hit the “edit” button for that site. Now hit the “settings” tab at the top and there is a field labeled “Upload Path”. You can specify a custom path here, or leave it blank to use the default path.

    You can also change the default path in your config file:

    define( 'UPLOADS', 'wp-content/'.'newfolder' );

    This will make the default path

    Thanks for the reply. That isn’t what I am looking for. I don’t want to change the upload path. I want to rewrite the path in the URL.

    Using the method you posted, which is documented in the codex, changes the directory in the filesystem where the file is uploaded and saved. If I upload to a site that has the ID 6, and change the upload path to “files”, I get a file saved in a files directory in my WordPress root. Also, it still appends /sites/6 to the URL.

    So, uploading abc.jpg is served at

    What I want is for the URL to be, regardless of where the file lives in the filesystem (the default is fine with me). This is how the files are served from my current sites on a pre-3.5 instance, and I like it. However, it makes use of ms-files.php and .htaccess rewrite rules. I am looking for a similar set of rules, for either network-wide rewriting, or for individual sites.

    Does that make more sense?

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    WordPress USED to do that out of the box, you’re right. It stopped because doing that was putting undue load on servers and causing conflicts with plugins. In general, it’s not a great idea.

    In your database, go into wp_sitemeta

    Look for ms_files_rewriting – I THINK if you set that to true, it’ll force WP to use the old ms-files stuff.

    Thanks for replying.

    I am not inclined to use ms-files.php, I was just wondering if there was a way to emulate it otherwise. I like having short file URLs.

    I am guessing there isn’t any other method folks are using, so I will drop my query.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    ms-files is the only way to pull it off, sadly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Looking for file URL rewriting best practices (trying to emulate pre-3.5 style)’ is closed to new replies.