WordPress.org

Ready to get started?Download WordPress

Forums

Moving media to subdomain (4 posts)

  1. OC2PS
    Member
    Posted 2 years ago #

    I have a small website hosted on shared hosting of a large global provider. The servers are not incredibly fast and are located outside my country.

    So I am looking at other ways to speed up my website - I have deployed Hyper cache, Use Google libraries and Autoptimize, and this has helped a lot.

    One of the recommendations for speeding up the site seems to be to store my images (or even all media files) in a subdomain rather than a subdirectory so that the broswer can have more concurrent connections.

    Is there an easy way to do this from the control panel for an existing website?

    I am thinking of not physically moving the files, but rather pointing the subdomain to the uploads directory. But beyond that I'm unclear - I probably need to tell WordPress where to pick images from...and not sure how to do that...

  2. OC2PS
    Member
    Posted 2 years ago #

    In case it's helpful for anybody else, here's what I did:

    1) Created a subdomain http://media.domain.com and pointed it to my WP uploads directory http://www.domain.com/wp-content/uploads

    2) In Settings > Media, put

    Store uploads in this folder: uploads
    Full URL path to files: http://media.domain.com

    3) In my
    UPDATE wp_posts SET post_content = REPLACE(post_content,'http://www.domain.com/wp-content/uploads/','http://media.domain.com/');

  3. vladec
    Member
    Posted 2 years ago #

    I changed everything, and its work - images are in subdomain, show perfectly in blog...

    but all new uploads create a folder in old domain. How to change future destitation for new files?

  4. Persephone33
    Member
    Posted 2 years ago #

    This is my question, too!! Does anyone have an answer? or more accurately, if you do want your new media files to go into your subdomain folder without getting an error what do you need to change in file.php (or anything) to get it to work without errors? (And for your authors as well?)

Topic Closed

This topic has been closed to new replies.

About this Topic