Created
May 18, 2016 22:25
-
-
Save jennimckinnon/c1696c5f022e7aadca886716e69f9c99 to your computer and use it in GitHub Desktop.
Protect error logs, wp-config.php, php.ini and .htaccess for WordPress sites.
This file contains hidden or 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
| <FilesMatch "^.*(error_log|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$"> | |
| Order deny,allow | |
| Deny from all | |
| </FilesMatch> |
Argh, I didn't escape the backslashes, I meant "php\.ini" or "php.?\.ini".
Author
This example was taken from the WP Codex so suggestions should be made there, to this doc: https://codex.wordpress.org/htaccess
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here, strictly speaking you should escape the period in "php.ini" ("php.ini"), and if unsure whether it has a number in it (php5.ini, php7.ini, whatever), you could simply use "php.?.ini" instead.