Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Shield

Security covered Under active development 29,670 sites

This module protects your site with HTTP Basic Access Authentication, requiring a username and password to access content. It's useful for hiding development or staging sites from public view.

Summary

PHP Authentication shield. It creates a simple shield for the site with HTTP Basic Access Authentication. It hides the sites, if the user does not know a simple username/password. It handles Drupal as a "walled garden".
This module helps you to protect your (dev) site with HTTP authentication.

Configuration

If you don't need the authentication just leave the user field blank.

  1. enable the module
  2. go to the admin interface (admin/config/system/shield) and fill the form
  3. nothing else :)

On plain old CGI

Since Drupal 7.23 you don't need any .htaccess modification for CGI (#670454: Support HTTP Authorization in CGI environment) but if you use plain old CGI you still need a modification:
Modify .htaccess, inside <IfModule mod_rewrite.c>. Add the following line at the beginning of the section:

  RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

Other

The original idea of the project came from chx. He also added tips for improvements. I'd like to thank the help and ideas of boombatower.

Note: If you want to use it only on a dev site, and not in the production site, I suggest you to consider using the Environment modules and reading issue #1394326.

Drupal 10–11

Ask your assistant about Shield

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • path_alias Drupal core

Required by

1 tracked project depends on this one

Activity

Tracked releases
4
Tracked since
Jul 2024
Latest release
1 week ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
8.x-1.11 Stable 10–11 Nov 3, 2026
8.x-1.10 Stable 9–11 Oct 21, 2026
8.x-1.9 Stable 9–11 Oct 21, 2026
8.x-1.8 Stable 9–11 Jul 2, 2024