I would like to deny in my htaccess all requests from my cdn providers server to files other than jpg/png/gif/css/js/txt files.
Right now I use:
RewriteRule ^robots\.txt$ robots_cdn77.txt [L]
To present for any request from my cdn provider a different robots.txt file to prevent google indexing my site via the cdn servers and create double content. The problem is was that google indexed my site double/trible times via the cdn urls. (they are cname host entries)
I would like to either add an additional rule or change the above one to avoid also users or site visitors can call my site via the cdn links.
In human words spoken something like:
If request is (from http:via
) anything with *worldcdn* and for a file other than jpg/gif/png than give as response not the file but cdn_error.php
so any request from *worldcdn* to http://www.domain.com/site/index.php would be changed into http://www.domain.com/cdn_error.php but a request to http://www.domain.com/images/logo.jpg would normal repond with the logo.jpg file.
BUT important is that this only happens for requests from worldcdn and not for any other visitor.
Thank you for your help in advance