Unwanted visitor won’t bring you any good or benefit. Unwanted visitor may harm your website or server and wasting your money indirectly. And since they don’t bring you any benefit and may cause harm to your server that will effect your loyal visitors/readers, so we need to block them.
So who is the unwanted visitors? Here some of them:
- Scrape Bot
- Vulnerable finder bot
- Spam bot
- Unknown spider/crawling bot
- DDOS attack
Those bot doesn’t do anything good for you, they stealing content, injecting malicious code, spam your comment box, and crawling your website for nothing. They just wasting your bandwidth, increase server load, slow down your server which may cause less experience for your loyal visitors. This should be stop.
You should stop those kind of visitors, you don’t need them. To block them you can do it with .htaccess.
To block by ip addresses:
<limit GET,POST> order allow,deny deny from xxx.xxx.xxx.xxx allow from all </limit>
To block by specific ISP:
<limit GET,POST> order allow,deny deny from some-evil-isp.com allow from all </limit>
To block by spider name:
<limit GET,POST> order allow,deny SetEnvIfNoCase User-Agent "libwww-perl" bad_bot=1 deny from env=bad_bot allow from all </limit>
To block by User agent:
RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^First_string_here [OR] RewriteCond %{HTTP_USER_AGENT} ^Another_string_here [OR] RewriteCond %{HTTP_USER_AGENT} ^Last_string_here RewriteRule ^(.*)$ http://your.domain.com/custom_error_page.html
To see the visitor’s ip address, user agents, or spider name you can see in your access_log. Or in WordPress you can install Statpress plugin to see your visitors detail and statistic. If you see something unusual just block them. You don’t need such visitors.
I have been having some spamming issues of late so this is a welcome tip. keep up the great work. 🙂
Thanks mate 🙂
Hi,
i am surya from india. Nice information about .htaccess.
i have site url like
http://www.mysite.com/sms/friendship/f1.html
http://www.mysite.com/sms/goodmorning/g1.html
http://www.mysite.com/sms/goodmorning/g2.html
but i want to display url like
http://www.mysite.com/sms/
when user seeing my site
How i can do this.
it is possible using .htaccess ? if yes then please help me .
I cannot understand what you mean. You want to turn 3 url with 1 single url?