Last active
July 19, 2018 10:12
-
-
Save niraj-shah/ac808ab6dbf4002490b845d79c170304 to your computer and use it in GitHub Desktop.
WordPress .htaccess Restrictions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .htaccess file for root WordPress directory | |
# add this line if it's not already present in your .htaccess file | |
ErrorDocument 401 default | |
<Files "wp-login.php"> | |
AuthName "WordPress Admin" | |
AuthUserFile "/path/to/passwd" | |
AuthType Basic | |
require valid-user | |
</Files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .htaccess file for wp-admin directory | |
# add this line if it's not already present in your .htaccess file | |
ErrorDocument 401 default | |
AuthName "WordPress Admin" | |
AuthUserFile "/path/to/passwd" | |
AuthType Basic | |
require valid-user | |
# allow anyone to access to admin-ajax.php | |
<Files "admin-ajax.php"> | |
Allow from all | |
Satisfy Any | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment