Skip to content

Instantly share code, notes, and snippets.

@Zodiac1978
Created October 10, 2022 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zodiac1978/e3d7125cf303ab3b0998837e96e6ea79 to your computer and use it in GitHub Desktop.
Save Zodiac1978/e3d7125cf303ab3b0998837e96e6ea79 to your computer and use it in GitHub Desktop.
Protecting the wp-login.php interferes with the page/post password protection. We need to exclude this page.
# Protect wp-login.php without interfering with post/page password protection
<files wp-login.php>
<If "%{QUERY_STRING} != 'action=postpass'">
# Protect wp-login.php
AuthName "Login erforderlich"
AuthType Basic
AuthUserFile /path/to/password-file/.htpasswd
require valid-user
</If>
</files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment