neilgee
6/12/2015 - 1:15 AM

.htaccess restrict site to certain IP addresses redirect others

.htaccess restrict site to certain IP addresses redirect others

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REMOTE_ADDR} !^220.239.238.84
 RewriteCond %{REMOTE_ADDR} !^220.239.238.83 /*add in your IP addresses and remove this comment*/
 RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
 RewriteRule .* /maintenance.html [R=302,L]
</IfModule>