Is it possible to include a external file to htacess? I have several virtual domains that should be allowed hotlinking between each other but not from outside, and I want to redirect differently according to the domain.
So if i had htaccess'es for eg. 3 domains (domain1.com, domain2.com and domain3.com) like this:
For domain1
For domain2
etc....
Then it would be great if i could use some kind of include since all the rewritecond's always are the same for all htaccess'es, only rewriterule differs.
Anyone has any ideas? Would really appreciate some tips
So if i had htaccess'es for eg. 3 domains (domain1.com, domain2.com and domain3.com) like this:
For domain1
Code:
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain1.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain1.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain2.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain2.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain3.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain3.com(/)?.*$[/URL] [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ [b][URL unfurl="true"]http://www.domain1.com/errorfordomain1.html[/URL][/b] [R,N]
For domain2
Code:
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain1.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain1.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain2.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain2.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?domain3.com(/)?.*$[/URL] [NC]
RewriteCond %{HTTP_REFERER} !^([URL unfurl="true"]www\.)?domain3.com(/)?.*$[/URL] [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ [b][URL unfurl="true"]http://www.domain2.com/errorfordomain2.html[/URL][/b] [R,N]
etc....
Then it would be great if i could use some kind of include since all the rewritecond's always are the same for all htaccess'es, only rewriterule differs.
Anyone has any ideas? Would really appreciate some tips