28-01-2012, 03:49 PM
The Secrets of .htaccess on web
[attachment=16801]
Prevent Hotlinking
If you don’t want other sites to page link directly to your images on your server, you can redirect the png/jpg request to a particular image (saying something like “this site is trying to steal my images”) with code like this:
Add the following code at the bottom of your .htaccess file to prevent hotlinking.
Block All Requests From User Agents
It's possible to block all unwanted user agents that might be potentially harmful or perhaps just to keep the server load as low as possible
Redirect Everyone Except Specified IPs
If for some reason you would want to deny everyone or allow only a specific group of IP addresses to access your website, add the following code to your
Create an IP Banlist
Tired of getting the same bs comments specific user over and over again? Just ban the bastard like this by adding the following code to your .htaccess file:
1allow from all
2deny from 123.45.6.7
3 deny from 012.34.5