Restrict Drupal routes by IP or range of IP
Restricted route form with preview of impacted routes
Global settings form to disable the restrictions and log for debugging

The Restrict route by IP module provides an interface to manage route restriction by IP address.

Features

- Access restriction with a set of IP and/or IP range.
- IP range can be defined as follow:

  • IP range with "-" (x.x.x.x-x.x.x.x)
  • IP range with * (x.x.x.*)
  • CIDR IP range (x.x.x.x/24)

- You can remove or just disable a route restriction
- You can see a preview of the impacted routes.
- Routes can be defined by:

  • route name
  • path
  • path with wildcard (using % like /admin/%/content)
  • regular expression

Installation

  1. Download or install with composer
  2. Enable restrict_route_by_ip
  3. go to /admin/config/system/restrict_route_by_ip to define all restrictions

AI Use

AI may be used or referenced during the development process for the creation of bug fixes and for code generation. Development is done primarily with human skill, and AI is mostly used for boilerplate or consultation.

Maintainers

Actively maintained by solideogloria.

Branches

2.0.x

Please use this branch if possible. It fixes ambiguity that 1.0.x contains when it comes to URL parameters. See #3405569: Allow if no params in URL or none in configuration. Add test coverage as well..

1.0.x

While this branch supports Drupal 11, it will not be updated to support Drupal 12. Future support will focus on 2.0.x and later branches.

Project information

Releases