How to store media files in subdomain

In order to parallelize downloads, i created already a subdomain for images. images.mydomain.com

Now, i don’t know how to move my media files, without breaking attachments, and after that, in the future, how to automatically store media file in subdomain.

Read More

Eventually, what i was thinking of doing was something like , redirect images.mydomain.com to mydomain.com/wp/content/uploads and after that replace all strings ‘http://www.domain.com/wp-content/uploads/‘with’http://images.mydomain.com/‘ using the wordpress plugin “search and replace”.

Does someone believes to know how to get around this?

thanks in advance

Related posts

2 comments

  1. You can move the uploads folder to the sub domain by doing this

    Open up your wp-config.php file, located at the root of your WordPress installation, and add the following code:

    define('UPLOADS', 'http://images.mydomain.com/uploads');
    

    The codex specifies that it should be added before the line that says require_once(ABSPATH.’wp-settings.php’);.

    Make sure the uploads folder is writable.

  2. Sometimes after adding the below code also found links are broken.

    define('UPLOADS', 'http://images.mydomain.com/uploads');

    So it is also a better idea to add redirection for a 100% workable solution. refer this

Comments are closed.