fun with htaccess

have you ever wonder one day you were designing your website and not satisfied with it? want to enhanced it a little bit? well, thats where htaccess comes in. here’s some trick you can do, provided that your webhosting, server or whatever support htaccess.

1. “damn the bandwidth stealer. i want them go away.” …erm, someone said to me that once. people hotlinking stuff, mostly images from your website and you don’t want them to do that? you can get rid of them by using htaccess. here’s how.
a) go to the path of your website.
b) edit (if you have the .htaccess file) or create a new file, naming it .htaccess.
c) put this into that file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?azfarismail.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://219.93.80.77.*$ [NC]
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ https://www.azfar.my/go_away.jpg

(remember to change the ip and the url. the “go_away.jpg” file is showed to the bandwidth stealer website when they are trying to hotlinking from your site. change it to your desired image. you can also use a blank page and change the path at RewriteRule.)
d) save the file and upload it into your website.
e) test it & now, hotlinkers begone!

erm, here’s… (more…)