Divi WordPress Theme

Block unwanted users from your site using .htaccess

Topic: Block unwanted users from your site using .htaccess  (Read 2569 times)

Offline Chris

  • Junior Guru
  • **
  • Posts: 81
  • iTrader: +0/-0
    • View Profile
Block unwanted users from your site using .htaccess
« on: May 01, 2019, 11:22:49 AM »
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?
VPS Hosting - AccuWebHosting

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 660
  • iTrader: +153/-0
    • View Profile
Re: Block unwanted users from your site using .htaccess
« Reply #1 on: May 01, 2019, 02:15:22 PM »
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

Offline techinfo

  • New Member
  • *
  • Posts: 19
  • iTrader: +0/-0
    • View Profile
Re: Block unwanted users from your site using .htaccess
« Reply #2 on: February 09, 2021, 06:31:21 PM »
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.

Offline etechsupport

  • Junior Guru
  • **
  • Posts: 54
  • iTrader: +0/-0
  • Technical Support
    • View Profile
Re: Block unwanted users from your site using .htaccess
« Reply #3 on: May 28, 2021, 07:16:53 PM »
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 .

Offline kumkum

  • New Member
  • *
  • Posts: 12
  • iTrader: +0/-0
  • https://hosting.india.to/
    • View Profile
Re: Block unwanted users from your site using .htaccess
« Reply #4 on: September 06, 2021, 07:45:00 PM »
The most simple way to prevent from unauthorized access is to add below code in your .htaccess file:
Code: [Select]
<files ~ "^.*.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfyall
</files>

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.
« Last Edit: September 06, 2021, 07:46:41 PM by kumkum »
Shopify Divi WordPress Theme
Tags:

Block domains in Smartermail

Started by AnonymousBoard Email Management Software & Email Clients

Replies: 1
Views: 5184
Last post July 05, 2007, 09:49:11 AM
by Kailash
block IP address in the server

Started by w3schoolBoard cPanel/WHM

Replies: 4
Views: 10235
Last post September 15, 2010, 04:18:02 PM
by brainpulse
Block for spam when sending out notifications in the catalog

Started by ChrisBoard WordPress Support

Replies: 0
Views: 1554
Last post October 30, 2019, 04:42:07 PM
by Chris