Web Hosting Main Forums > Hosting Security and Technology

Block unwanted users from your site using .htaccess

(1/1)

Chris:
My website is being attacked from different IP addresses. It is fake request but I am seeing common user agent. Is there anyway to block such traffic using .htaccess and user agent?

Kailash:
Yes, it is possible to block the access based on user-agent. You can refer our following KB:

Block unwanted users from your site using .htaccess

In this KB, refer section "Block bad users based on their User-Agent string" for more details.

Hope this will help you.

- Kailash

techinfo:
yes you can block user from .htacces file htaccess which is a file you can access if you're running Apache as your web server By denying an IP address' access in Apache web server's configuration file, the banning process can be executed before your site is fully loaded.

etechsupport:
Block Bad Bots with . htaccess

* FTP to your website and find your . htaccess file in your root directory.
* Create a page in your root directory called 403. html, the content of the page doesn't matter, our is a text file with just the characters “403”

* Browse to this page on AskApache that has a sample . ...
* You can add any bots to the sample . ...
* Test your .

kumkum:
The most simple way to prevent from unauthorized access is to add below code in your .htaccess file:

--- Code: ---<files ~ "^.*.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfyall
</files>
--- End code ---

If you are using cpanel then you can also add particualr IP address to prevent access from those IP's.
For more details regarding prevent unauthorized access from .htaccess you can check.

Navigation

[0] Message Index

Go to full version