CDN sitemap image url rewrite
-
Hi,
Quick question: I am using W3TC and I am trying to rewrite the image URLs in my Yoast SEO site map to use my domain name rather than my *.cloudfront.net CDN url for SEO(duplication – all images deindexed) currently and vanity purposes. I have seen this code to change TO your CDN in the sitemap.xml:
function wpseo_cdn_filter( $uri ) { return str_replace( 'https://example.com', 'https://cdn.example.com', $uri ); } add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' );
I understand what this does and doing the reverse (rewrite my CDN url to my domain url) but I have several *.cloudfront.net urls and would need an array?
My question: do i just repeat this snippet entirely for all *cloudfront.net urls i am using or do i need an array? If I need an array, what is the correct code. Repeating the above (reversed) is straight forward to me. Thanks
Julian
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘CDN sitemap image url rewrite’ is closed to new replies.