Reputation: 83
For the life of me I can't work this out.
I have one main domain, hosting a busy website. (domain1.com)
I have a second domain, which uses content from domain #1. To link the images on this second site I want to use images.domain2.com.
images.domain2.com has been set up as an alias on domain1.com.
So now if someone goes to images.domain2.com they see domain1.com content, I don't want people to see this. (duplicate content).
I want it to work though, if someone requests images.domain2.com/images/image1.jpg.
Does this make sense?
Upvotes: 0
Views: 505
Reputation: 7279
Try this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^images\.domain2\.com [NC]
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml)$
RewriteRule ^(.*)$ domain2.com/$1 [L]
</IfModule>
Upvotes: 1