htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Hotlinking Optimization?
PostPosted: 18 Dec 2007 15:59 
Offline

Joined: 13 Sep 2007 11:05
Posts: 4
Hi,

I am using an .htaccess file to block people from stealing my bandwidth but I want it to allow me domain and ther 2 subdomains.

I am using the below code which is working fine but could the code be made smaller?

Code:
<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteCond %{HTTP_REFERER} !^$
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.net [NC]
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?media.mysite.net [NC]
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?topsites.mysite.net [NC]
  RewriteRule \.(jpe?g|gif|bmp|png)$ /img/nolinking.jpe [NC,R,L]

  RewriteCond %{HTTP_REFERER} !^$
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.net [NC]
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?media.mysite.net [NC]
  RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?topsites.mysite.net [NC]
  RewriteRule \.(swf|mp3|wmv|zip)$ http://mysite.net [NC,R=301,L]
</IfModule>


Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB