How to Secure Your Magento Admin to Restrict Access to Specific IP Address with HTACCESS

It is extremely important to lock down your Magento admin panel. Once hackers have gained access to a store administration panel they can begin spamming customers, stealing sensitive customer and store owner information or begin to execute phishing attacks against your customers. They can also begin attempting to exploit server weaknesses by uploading malicious files via admin functionality. One of the best ways to restrict access is by limiting the IP address that can even access the admin section.

The following rule inside your stores root .htaccess file will restrict this access to the IP Address (you would change this to match your IP Address)

The previous rule has the expectation that your stores administrative path was left as “Admin”. However, as leaving your path as admin is in itself a security risk the following shows how to change it to a new administrative path, for this example we will use “secureadmin”

By updating the first line of the provided htaccess you are able to update the administrative path restriction as required.

Hans-Eirik Hanifl

view all posts

Hans-Eirik Hanifl is a forward thinking e-commerce and marketing consultant. As an advocate for the free exchange of knowledge, he founded E-Commerce Gorilla as a place where like-minded individuals can ask questions and share their expertise on practical solutions in the area of e-commerce and marketing. He is the owner of TRM Marketing and an avid supporter of the open source community.

0 Comments Join the Conversation →

Leave a Reply

Stay in the loop!

E-Commerce Gorilla Avatar

Join the E-Commerce Gorilla e-mail newsletter. We provide monthly updates on new articles featuring all aspects of online sales and E-Commerce setup. We cover the do's and don'ts of effective online sales, along with great giveaways. As a newsletter subscriber you are automatically entered for any competitions and giveaways.* Join our community of engaged online marketing experts, great content, and great giveaways. You can't go wrong.