I recently bought a CDN and configured it. On my site, the images are stored in a folder called βimagesβ, and the image URLs are obviously related in this way. (* Ex: images / some_image.png *)
Since I want to use the CDN correctly, I need to rewrite the URLs without manually changing each image path.
I tried the .htaccess code that was suggested for a similar problem
RewriteEngine On RewriteBase / RewriteRule ^images/(.*)$ http://cdn.mydomain.com/$1 [L,R=301]
But this does not work properly, since all the images were connected incorrectly.
So, I would like to know the changes in this code. Any answer would be appreciated.
source share