Allow multiple IPs to access WordPress Site Admin via .htaccess

I currently have a wordpress site that is being upgraded and I have a maintenence redirect setup in the .htaccess file.

I can allow my own IP access the site and admin but how can I allow multiple IPs access for the other editors to also have access.

Read More

I’m currently using :

     
     RewriteEngine on
     RewriteCond %{REMOTE_HOST} !^123.456.789.101
     #RewriteCond %{REMOTE_ADDR} !^123.456.789.101
     RewriteCond %{REQUEST_URI} !/maintanence.html$ [NC]
     RewriteCond %{REQUEST_URI} !.(jpe?g?|png|gif) [NC]
     RewriteRule .* /maintanence.html [R=302,L]
    
    

Related posts

Leave a Reply

2 comments

  1. Well you wanted IPs not hosts, so make sure to do that. Then chain them together using your intended logic:

    RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
    RewriteCond %{REMOTE_ADDR} !^127.0.0.2$
    RewriteCond %{REMOTE_ADDR} !^127.0.0.3$
    RewriteRule .* /maintenance.html [R=302,L]