Hotlink Protection a small problem.

#1
Hello.
I've started this web server. It's works great, but i have problem with hotlink protection.
In Virtual Hosts i have:
Code:
 Enable Hotlink Protection	Yes
 Suffix	jpeg, jpg
It's works, but i have in /home/services/httpd/html/banners/ my banners (*.gif, and *.swf). This files need to have Disable hotlink protection.
A lots of people links my baners in yourself sites, but now banners don't show :(
What is wrong ?? What I must change ?

In httpd.conf (Apache 2.0) i was:
Code:
LoadModule rewrite_module       /usr/lib/apache/mod_rewrite.so                                                              
                                                                                                                            
<Directory "/home/services/httpd/html/jpg/art">                                                                         
        RewriteEngine on                                                                                                    
        RewriteCond %{HTTP_REFERER} !^$                                                                                     
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.net(/)?.*$     [NC]                                             
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.ws(/)?.*$     [NC]                                        
        RewriteRule .*\.(jpg|jpeg)$ http://www.mydomain.net [R,NC]                                                            
</Directory>                                                                                                                
                                                                                                                            
<Directory "/home/services/httpd/html/jpg/wallpapers">                                                                      
        RewriteEngine on                                                                                                    
        RewriteCond %{HTTP_REFERER} !^$                                                                                     
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.net(/)?.*$     [NC]                                             
        RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.ws(/)?.*$     [NC]                                        
        RewriteRule .*\.(jpg|jpeg)$ http://www.mydomain.net [R,NC]                                                            
</Directory>
Ps. Sorry for my english. I still learnt this language :oops:
 

mistwang

LiteSpeed Staff
#2
Thank you for using our product.

It is not a problem of hotlink protection configuration, as "gif" and "swf" are not in the suffix list.
It is caused by improper permission masks on *.gif and *.swf, the execution bit is on, I believe.
please try
Code:
chmod a-x *.gif *.swf
under your banners directory.

By default, LSWS does not serve static files with execution bits on, if it is not perfered, please set "Restricted Permission Mask" under "Server"-> "Security" tab to "000".

Please let us know whether it is fixed or not.

Best regards.
 
#3
Everything was good.
But i was in Virtual Host Mappings i forgot add domain.ws
i was only mydomain.net and www.mydomain.net
Everyone has linked my banners from domain.ws address :)

It was stupid things.
Thanks for help.
 
Top