I have tried a lot of different methods of restricting the access via .htaccess and I can not get it to work. I have tried both methods on production and on fresh magento installation on new cPanel. Any idea why this doesn't work?
Method 1:
Order deny,allow
Deny from all
Allow from 1.1.1.1
Method 2:
RewriteCond %{REQUEST_URI} ^/admin/ [NC]
RewriteCond %{REMOTE_ADDR} !^1.1.1.1
RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L]