Created
March 7, 2018 19:07
-
-
Save BenRacicot/5a919252559a704e305bc3e476ca81d3 to your computer and use it in GitHub Desktop.
Disaalow anyone except your network IP to access wp-admin login page (or any page) via .htaccess file
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
# Only allow internal IP to access login page | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] | |
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$ | |
RewriteCond %{REMOTE_ADDR} !^xx.xxx.xx.xxx$ | |
RewriteRule ^(.*)$ - [R=403,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment