Creating your Media Folder Subdomain
-
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!!!
- The topic ‘Creating your Media Folder Subdomain’ is closed to new replies.