How to block multiple IP addresses in .htaccess

Apache: How to block multiple IP addresses in .htaccess

If you need to block more than one IP address you can do this quite easily. Put each one of the IP addresses next to each other with a space in between.

  1. Deny from x.x.x.x y.y.y.y z.z.z.z

(Replace the x.x.x.x / y.y.y.y / z.z.z.z with the IP addresses that you wish to block access to)

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about How to block multiple IP addresses in .htaccess

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the Apache language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How to install and use jpegoptim on Linux CentOS

How to set up custom error pages in .htaccess for your Apache server (ErrorDocument)

How to sort an array in javascript?

How to get a route to directly show a view?

How to fix the MySQL related "Specified key was too long error" error in Laravel

How to output (echo/print) content in PHP

What are the SPL data structures

How to undelete a soft deleted Eloquent row?

How to provide a default model object for relationships?

How to create random numbers in JS?