comprar viagra online
comprar viagra generico barato
comprar cialis generico online
comprar cialis online seguro
Ban users from your website using the .htaccess file |
Do you want to ban people from your website? Of course you can code this in PHP, but the most efficient way to do it, is to put it in the .htaccess file of your host. This way, you can also disable hotlinking of images or other files that are hosted on your website. Keep your website yours, don't let it be taken over by useless spammers, bots and other annoying people. Be careful when banning entire ranges of IPs, as you may also be blocking legitimate traffic! User IP Ban Valid entries: xxx.xxx.xxx.xxx, where "xxx" is a number between 0 and 255. In the .htaccess files you can specify a certain IP from your site, but you can also block full ranges. Examples:
To actually set the User IP Ban, put this code in your .htaccess file of your server (or create one of your own): ## USER IP BANNING <Limit GET POST> order allow,deny deny from 42.13.6.32 deny from 212.172.49. deny from 69.241. deny from 81.143.4 allow from all </Limit> Site Referrer Ban Example Valid entries:
To set an Site Referrer Ban, put this code in your .htaccess file: ## SITE REFERRER BANNING RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} somesite.com [NC,OR] RewriteCond %{HTTP_REFERER} somesite. [NC,OR] RewriteCond %{HTTP_REFERER} subdomain.somesite.com [NC] RewriteRule .* - [F] *Note: Do not include "http://www." portion of the URL* Disable hotlinking Example Valid entries for Allowed domains / IPs:
Example Valid entries for List of file types:
To Disable hotlinking, put this code in your .htaccess file: ## DISABLE HOTLINKING RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?marcofolio.net/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?subdomain.marcofolio.net/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?195.47.247.126/.*$ [NC] RewriteRule .(gif|jpg|css|js)$ - [F] *Note: Only include the allowed domain names. Your own domain is automaticly allowed to access the files.* Good luck using this knowledge, get rid of those annoying people. Tags: ban website design htaccess internet Interested in this topic? You might enjoy another article I've written called |
< Prev | Next > |
---|
Search |
---|
Or try the sitemap |