Magento: Restrict admin access to only approved IP addresses using HTACCESS
Restrict admin access to only approved IP addresses
RewriteCond %{REQUEST_URI} ^/(index.php/)?admin/ [NC] RewriteCond %{REMOTE_ADDR} !^123.176.46.90 RewriteCond %{REMOTE_ADDR} !^123.176.46.91 RewriteCond %{REMOTE_ADDR} !^123.176.46.92 RewriteCond %{REMOTE_ADDR} !^123.176.46.93 RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L]
Remove admin access to specific IP addresses
RewriteCond %{REQUEST_URI} ^/(index.php/)?admin/ [NC] RewriteCond %{REMOTE_ADDR} ^93.115.92.169 RewriteRule ^(.*)$ http://%{HTTP_HOST}/access-denied.html [R=302,L]
Note: Assuming that the administration path is “admin”. If your admin path is different then replace “admin” with your admin path.