Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: Token Browser 1.0.2 Minor update available for module token_browser (1.0.2). Release: Varbase Project 11.0.8 Minor update available for module varbase_project (11.0.8). Release: Media Remote Image 2.0.0-beta1 First beta version released for module media_entity_remote_image (2.0.0-beta1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Security Coverage: Module Scout Module module_scout now has official Drupal security advisory coverage.

HTTP Client Error Status Block Condition

328 sites Security covered Drupal 10–11
View on drupal.org

This module allows you to display blocks based on specific HTTP client error codes, such as 404 Not Found or 403 Forbidden. It provides a condition plugin that can be used to control block visibility.

The module provides a Condition plugin for blocks, checking the status code for 40x range of client errors.

Use this to place a block using a Condition plugin to check the HTTP client error status code.

Therefore, one simple use case would be to display a block on a 404 Not Found page or a 403 Forbidden page.

The supported HTTP Client errors page codes are:
* 401
* 403
* 404

How to use

Install the module.
Go to the Block layout page (/admin/structure/block).
Select Place block for the region you would like the block to appear.
Select the block you want to appear, from the Place block popup.
Under the Visibility conditions, select the vertical tab labelled "HTTP 40x Client error status code".
Select the status code you want the block to appear on.
This can be combined with the other Visibility conditions, such as Pages or Roles.

Versions

8.x-1.x works for all versions of Drupal 8, but not Drupal 9.
8.x-2.x works with Drupal 8.7.7 and higher, including Drupal 9 and 10.
3.0.x works with Drupal 9 and higher, including Drupal 11. I recommend all users to upgrade to this version. You can upgrade from 1.x or 2.x to 3. Version 3.0.0 did support Drupal 8.8.3 but this has been dropped to simplify allowing Drupal 11 support.
3.1.x works with Drupal 10.2 and higher. Ensure you update to at least Drupal 10.2 before running some of the drush commands. Once on Drupal 10.2 you can safely upgrade from previous versions of the module.

As the majority of the functionality now exists in core, there is no further development of this module planned.

Related modules

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
3.1.5 Stable 10–11 Jun 29, 2026
3.1.4 Stable 10–11 Jun 13, 2026