• I made a post about this in the Fixing WordPress forum by mistake, but I don’t want to explain myself, admins can delete it. I just want to get my subdomain up as quick as possible and I am confused about the process as I haven’t found any documentation that I think is credible enough to follow blindly. So far:

    – I created the subdomain in my cPanel and a folder was created under public_html
    – I went into options.php and made the upload_url_path the url of my subdomain. I left upload_path blank, I don’t know if I should update it.
    – Using my hosting file manager, I moved all the files from uploads to the subdomain folder

    – My next step is to update old image paths. The code I have is:
    UPDATE wp-posts SET post_content = REPLACE(post_content, ‘https://yourdomain.com/wp-content/uploads/’, ‘https://media.yourdomain.com/’)
    …but the “post” in it makes it look like it will only do it for posts. I have products. Is it still the same SQL command?

    – Step after is to update image links in media library, but I only found this in 1/3 of my sources. Do I need to do this? The SQL is:
    UPDATE wp_posts SET guid = REPLACE(guid, ‘https://yourdomain.com/wp-content/uploads/’, ‘https://media.yourdomain.com/’)

    – Last is adding code to .htaccess. I found two variants. The shorter one is:
    RedirectMatch 301 ^/wp-content/uploads/(.*)$ https://media.yourdomain.com/$1

    What about adding the define command in wp-config.php?

    The second last point I am sure about. I am truly grateful for anyone with the knowledge and enough patience to shed some light on this for me.
    THANK YOU!!!

Viewing 1 replies (of 1 total)
  • Thread Starter Tomi

    (@tomitech)

    I understand this is not just for posts now. When I did this, it only did it for 30 rows. I then did the following step (it said 124 rows for that one). I have 366 pictures. For both, I had to put the URL in double quotes (“), else it wouldn’t work. In short, it didn’t work. Next step is to restore from backup because every picture on my site will no longer display. I don’t understand why. I planned this very carefully…

Viewing 1 replies (of 1 total)
  • The topic ‘Creating your Media Folder Subdomain’ is closed to new replies.