I'm using a CDN for serving my images on my Wordpress..
The URL structure goes as such:
//mydomain.com/assets/uploads/[year]/[month]/[day]/[imagename].png or whatever
For my CDN the images are served as:
//cdn.cdnnetwork.com/mydomain.com/assets/uploads/[year]/[month]/[day]/[imagename].png or whatever
Now the problem is that whenever the image gets accessed directly either with typing in the exact url or a search engine redirecting it they all go to:
//mydomain.com/assets/uploads/[year]/[month]/[day]/[imagename].png or whatever
I want to use .htaccess rule or any other way to redirect all
//mydomain.com/assets/uploads/[year]/[month]/[day]/[imagename].png or whatever
links to:
//cdn.cdnnetwork.com/mydomain.com/assets/uploads/[year]/[month]/[day]/[imagename].png or whatever
So I can save bandwidth... Is it possible? The images embedded in a actual webpage using the img tag are fine it's just direct access to the images.