Forums

Moving WordPress Multisite Upload folder to a subdomain (5 posts)

  1. Andrew Smith
    Member
    Posted 8 months ago #

    Hi all.

    I'd like to edit my uploads destination folder to point all files and media to a subdomain.

    Basicly I'd like my upload folder to be set in the subdomain "static.mydomain.com".

    What have I to do to make this work fine?

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 8 months ago #

    It's not easy.

    You can edit the settings (WP Admin -> Network -> Sites - hover over the site, click edit, go to Settings and change it there) per site.

    You may want to grab a CDN plugin and see how they do it.

  3. Andrew Smith
    Member
    Posted 8 months ago #

    I know what you mean but think is this enough?

    In the Settings Tab I see:

    Upload path: wp-content/uploads

    I think it's automatically redirected to blogs.dir folder through functions.php, right?

    What value would you use for the Upload path?

    1. Upload path: static.domain.com
    2. Upload path: http://static.domain.com
    3. Upload path: http://static.domain.com/somfolder

    ???

    And, again, do you think this will be enough?

    Edit:
    In the Settings Tab there's also the option "Upload Url Path" (blank field, no value by default)...
    What about that?

    And what about the "Fileupload Url" option (default value is: "http://domain.com/wp-content/uploads")?

  4. Andrew Smith
    Member
    Posted 8 months ago #

    Desired result:

    I'd like that all uploads that usually are located in
    domain.com/wp-content/blogs.dir/1/files
    domain.com/wp-content/blogs.dir/2/files
    domain.com/wp-content/blogs.dir/3/files

    will be located in
    static.domain.com/blogs.dir/1/files
    static.domain.com/blogs.dir/2/files
    static.domain.com/blogs.dir/3/files

    People on the front end eventually will see:
    static.domain.com/files

    If I'll be able to set this configuration I think there's no need for CDN plugin...

  5. Curtiss Grymala
    Member
    Posted 8 months ago #

    Andrew - the point ipstenu was trying to make, I think, was that WordPress normally only accepts relative paths for the uploads folder. If you want to modify it to be a completely different domain, you're going to have to do some digging. The CDN plugins have already solved that issue within WordPress; though they are generally pointing to a CDN provider rather than pointing to somewhere else on your own server.

    Therefore, the best course of action would be to download one of those CDN plugins and open it in your code editor. Then, do a little searching through the plugin to see how they were able to short-circuit the upload path. Once you figure that out, make your own plugin (or put it in your theme's functions.php file) to short-circuit the upload path in a similar way; but using your custom location rather than the CDN location.

Reply

You must log in to post.

About this Topic