Recently Magento updated the post: "Protect your Magento Installation from Password Guessing", see: https://magento.com/security/best-practices/protect-your-magento-installation-password-guessing-new-update
While in the original post they advised to put the following in the root .htaccess file:
RewriteCond %{REQUEST_URI} ^.*/ADMIN_PANEL_LOCATION [OR,NC]
RewriteCond %{REQUEST_URI} ^.*/DOWNLOADER [OR,NC]
RewriteCond %{REQUEST_URI} ^.*/RSS/CATALOG [OR,NC]
RewriteCond %{REQUEST_URI} ^.*/RSS/ORDER [NC]
RewriteCond %{REMOTE_ADDR} !^1.2.3.4
RewriteCond %{REMOTE_ADDR} !^5.6.7.8
RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L]
Now they seem to recommend the following approach:
# Whitelist an IP address for the admin panel
RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php/)?admin/ - [L,R=403]
# Whitelist an IP address for the RSS feed
RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php/?)?rss/ - [L,R=403]
and put this in the ./downloader/.htaccess file:
order deny,allow
deny from all
allow from xx.xx.xx.xx
I am not much expert on this subject, so I was wondering:
- if both the first and second method are good for Magento 1
- what the difference really is between one approach over the other and if there's one which is better