For a image gallery I have to install a CDN Domain.
Default Domain:
http://www.example.com
Apache folder: /html/mywebsite
CDN Domain:
http://cdn.example.com
Apache folder: /html/mywebsite
The CDN Domain need the same Apache folder for url rewrite reasons etc.
Problem:
http://cdn.example.com
and
http://www.example.com
open the same website and this is bad. I cant rewrite (301) from cdn to www because I have to serve the images from the CDN. Also I cant use a 403:
RewriteCond %{HTTP_HOST} ^cdn\.example\.com$ [NC]
RewriteRule .* / [F]
because image urls from the cdn
http://cdn.example.com/images/test.jpg
get also a 403. Is it possible to make a 403 only for the root folder and not for subfolders or do you have a better idea?
btw. robots.txt is also bad, because images from the cdn should be indexed. A htaccess solution would be great.