Magento – provided only specific domains with password protection in a multi-store, with multiple domains

We were working on a multi-store, with multiple domains for several different front ends.

Now, a new front end with a new domain should be added. Of course, the task was to make the domain and the shop before the official release is not available to. Thus, a solution had to be, to a single domain but not to block the entire shop.

Many hosters offer the possibility comfortable to provide a directory with password protection – usually with a .htaccess solution. This would bring us but not much here, because we do not or a solution to only one domain, the Magento installation. the directory needed.

The .htaccess solution, however, to use for this case but slightly modified. It can be either from his Hoster create a .htaccess file now or do so at one of the online platforms such as e.g.. HERE.

This .htpasswd you put off at the .htaccess in the root of Magento.

Then you open the .htaccess and writes down there following code:

AuthUserFile /Serverpfad/zum/Magentoverzeichnis/.htpasswd
AuthType Basic
AuthName "Not everyone comes in here..."
Require valid-user

SetEnvIf Host www.die-zu-sichernde-Domain.xyz secure_content

Deny from env=secure_content

Satisfy Any

Of course, both the path to the .htpasswd and the secured end domain be replaced with your own data.

Now the desired domain should be backed up and only if the correct user and password to see his.

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *