Use custom url with S3 uploads plugin for wordpress to AWS cloudfront

31 Views Asked by At

I have taken over a WordPress blog that uses the S3 uploads plugin to host images via AWS Cloudfront on an S3 instance.

The cloudfront url is something like: https://ake12sa38qwe.cloudfront.net, so the image source linked on my blog looks like: https://ake12sa38qwe.cloudfront.net/uploads/image.jpg. To improve my backlink profile, I want to use a custom URL with my domain instead of the cryptic cloudfront url, something like: www.mydomain.com/uploads/image.jpg

I have already managed to set up an alternative URL (*.mydomain.com) in Amazon Cloudfront Manager and a redirect via CNAME record with my web hosting service (Hostinger). However, I don't know how to implement the alternative URL into the S3 plugin configuration and what else I need to do to get my custom url set in the media upload manager on wordpress.

My S3 plugin configuration in wp-config looks like this:

define('S3_UPLOADS_BUCKET', 'mydomain-wordpress-media');
define('S3_UPLOADS_BUCKET_URL', 'ake12sa38qwe.cloudfront.net');
define('S3_UPLOADS_HTTP_CACHE_CONTROL', 24 * 60 * 60);
define('S3_UPLOADS_KEY', 'AASKL9LKJLKJ3B3KK');
define('S3_UPLOADS_SECRET', 'asdnkljasdhLKJSADLKJasdlkhj21');
define('S3_UPLOADS_REGION', 'eu-central-1');
define('S3_UPLOADS_AUTOENABLE', false);

I would be very grateful if someone could help me further...

0

There are 0 best solutions below