Hi, I migrated my website from a traditional shared hosting where my images are served from a subdomain. All the media library file path are coded to this extremely long path "http://woocommerce-123456-123456.cloudwaysapps.com//home/123456.cloudwaysapps.com/xxxxxx/public_html/sub.domain.com/xxxxxx.png"
I’ve changed the “upload file path” and “upload file url” in the “wp_options” table in the database, but all new uploads continue to go to that long path above.
I’ve got a separate application setup for the images domain, I’ve tested the links are working.
How do I point the media library file url to my images application?
You need to do the following:
UPDATE wp_posts SET post_content = REPLACE (post_content,'http://yoursite.com/wp-content/uploads/','http://img.yoursite.com/');
I would suggest to give it a read thoroughly.
As I mentioned in my post, I’ve done all these already. My images were successfully serving from the subdomain with my previous shared host. When I migrated to Cloudways, all the urls have changed and changing upload_url_path or the upload_path doesn’t change the url. Database search doesn’t find anything in wp_posts. Are you able to get in my site and have a look?
I found the issue. The uploads path has been hard coded into the wp_configs.php.
However, I also found that it is not possible to serve images from a subdomain with the “applications” arrangement in Cloudways. It wouldn’t upload to root folder of another “application”, which is your subdomain.
Thanks for the update. How about creating a folder something like "Images’, so that the URL looks like:
Try it out, it should work fine.
P.S: I didn’t test it. If that doesn’t work, let me know.