Hi,
I have recently moved my jpg images to a content delivery network (CDN). The cdn pulls the images via the domain origin.mysite.com and serves via cdn.mysite.com
The old image locations are something like:
www.mysite.com/images/pic.jpg
the new ones are
cdn.mysite.com/images/pic.jpg
I've just changed the filepaths in my html and php files to target the files on the cdn.
I thought it might be a good idea to rewrite old images to the new location.
Tried the following:
<FilesMatch "\.jpg$">
Header set Cache-Control "must-revalidate, max-age=2592000"
RewriteCond %{HTTP_HOST} !^origin\.mysite\.com
RewriteCond %{REQUEST_URI} !(file1|file2|file3).jpg$
RewriteRule ^(.*)$ http://cdn.mysite.com/$1 [R=301,L]
</FilesMatch>
My questions:
Why do the rewrite rules only work if they are NOT inside the <FilesMatch>?
Will requests NOT go through the rewrite conditions inside the <FilesMatch> if jpg images are requested? I placed them inside the <FilesMatch> because I assume better performance, is that right?
Without rewriting, my images are accessible via two locations. I'm not sure if this is a SEO issue because it's just images. Does anyone know about that?
Most of my images are indexed in search engines with their old addresses. Will they disappear from the SERPS and get replaced by the new ones because they are no longer linked from my pages (but still available, in case i don't rewrite them)?
Do you think it would affect search engine rankings if I just left them available at both locations?
Thanks in advance!