Skip to content

Instantly share code, notes, and snippets.

@shirokoweb
Created October 2, 2021 19:45
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 shirokoweb/9e28b45668b780bea0f0ccf64aff3ef8 to your computer and use it in GitHub Desktop.
Save shirokoweb/9e28b45668b780bea0f0ccf64aff3ef8 to your computer and use it in GitHub Desktop.
Resttrict wp-login to IP address
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^10\.110\.20\.220$
RewriteCond %{REMOTE_ADDR} !^20\.220\.30\.330$
RewriteRule ^(.*)$ - [R=403,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment