-1

My site got hit ddos several times till now, i found that ddos traffic generally comes from linux os ... then, i wonder how to block linux users / traffic from accessing a site with htaccess??

Please advice..

Arya99
  • 13
  • 2
  • 2
    You want to block _all_ Linux users?! You are unlikely to block an intentional DDOS attack using `.htaccess`. – MrWhite Jul 07 '20 at 12:23
  • I use Linux right now. Half the people reading this do as well. If you block Linux and I can't get to your site, I won't buy your stuff, I'll leave a negative review on Yelp, etc... – Michael Hampton Jul 07 '20 at 12:58

1 Answers1

1

The short answer is that you can't.

The long answer: I doubt your solution is a sound one.

First, it might not be the best business practice to make your site unavailable to a bunch of people. Some of your customers might use Linux, and if they can't reach your page, they probably won't try again (I certainly wouldn't). This of course depends on what is on the page, so you might not see it as a strong point.

Second, by the time your server gets to the point of checking the client and deciding if the connection should be denied, it is already too late. The connection is already established, so in the case of a DDoS attack, you will gain next to nothing with this approach. This holds to any kind of checks done with htaccess, in fact, to any kind of checks done by your server (even by a firewall).

You might want to see this post about DDoS attacks, as it lists solutions to the problem which could actually work.

Lacek
  • 6,585
  • 22
  • 28