change upload media folder to subdomain

Hello there

I wanted to change the default upload folder for all media, so as to locate them on a subdomain.

Why? Bc I've read this makes the upload of the site faster, but also because I understand -correct me if I'm wrong- that this is a good manner of protecting unwanted media download from your site. I would like the site to be a private membership site (for a school) and would like to avoid eg any picture to be downloaded by non members if they have the url.

I don't really mind changing paths of already posted media as the site is quite new, and the number of media to reload and/or paths to rename, if any, is quite limited.

I chcked the forums, and tried to change the code but it didn't work... :disappointed:

thanks a lot for your help :slight_smile:
Caroline

  • Bojan Radonic

    Hey there Caroline,

    How are you doing today?

    Masking image URL won't stop image from being displayed on your site, if image is displayed on your site you can't prevent people simply downloading it.

    Did you consider maybe using our Membership 2 for that? Membership 2 has Media Protection add-on that you can use to protect images (hide them completely for members that do not have access) or even use masking rules to mask the URL to those images.

    Aside from that you can protect pages or posts, even parts of them for only members of your site.

    Please let me know if that could work for you and if you need some help with setting those protection rules :slight_smile:

    Cheers,
    Bojan

  • Caroline

    Hello Bojan,

    Thanks for this speedy answer! :slight_smile:

    Nice to know it doesn't help privacy to locate media on subdomain. FYI, I eventually managed to change the uploads folder by following the instructions here: https://premium.wpmudev.org/blog/change-default-wordpress-uploads-folder/ , then reuploaded the media via the media uploader, and relinked the images (as told, I hadn't a lot, so this was an option for me). Somehow, I was too quick in testing it and/or had to log out/in, and after that it worked.
    This one http://www.dezzain.com/wordpress-tutorials/how-to-move-wordpress-uploads-path-to-subdomain/ was useful too and might be better way for people with more content.

    Regarding the memberships plugin (which indeed I was considering to use :slight_smile: ), is there any way to
    (i) add members not using the WP username (ie only using email address and password)?
    (ii) to moderate membership (ie members only become members after admin approval)?
    And if so, could you help me out or indicate where I can find the tutorial therefore :slight_smile:? If you can also introduce me on how mask the url, that would be great :slight_smile:

    Thanks a lot! :slight_smile:
    Caroline

  • Bojan Radonic

    Hey again Caroline,

    Glad you managed to do that and thanks for sharing the link for the sake of other members :slight_smile:

    (i) add members not using the WP username (ie only using email address and password)?

    By default username is required in WordPress and there is no way out of a box of doing that so that part would have to be custom coded. I found this so it's definitely possible to "hack" it but I'm pretty sure this part will not work well with Membership 2 registration and it will only be applied to default WP registration so I wouldn't suggest that unless you absolutely need to implement this.

    (ii) to moderate membership (ie members only become members after admin approval)?

    You can try using solution from this thread here. It's not ideal if you're intending this to be paid membership. Alternatively you can try using Invitation Codes so only members that have those would be able to register. You can activate the add-on in Membership 2 -> Add-ons after which you can create codes in Membership 2 -> Invitation Codes

    If you can also introduce me on how mask the url, that would be great

    Masking URL is being done from Membership 2 -> Add-ons, once there click on Details in Media Protection, see screenshot:

    After that simply insert folder name that will be displayed in your page HTML instead of the real one, see screenshot 2:

    Hope this helps :slight_smile:

    Cheers,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.