Magento: Admin on a separate domain

Magento: Admin on a separate domain

October 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Admin on a separate domain

Setting Up Magento Admin on a Separate Domain

As an experienced Magento developer, I often get asked about setting up the admin panel on a separate domain from the frontend. This can be useful for security reasons or when you want to keep your admin interface segregated from customer-facing areas of your site. In this post, we’ll discuss how to achieve this in Magento Commerce Edition (CE) 1.9.0.1.

Understanding the Problem

The default setup doesn’t allow for an easy separation of the admin panel and frontend URLs. By default, both are located under the same domain with a common base URL. In your case, you want:

  • Frontend: http://www.domain.com/storecode/urlpath.html (HTTPS for account & checkout pages)
  • Admin: https://sub.domain.com/adminpath/

The Current Approach

You’ve already made some attempts at solving this issue:

  1. You’ve set a custom admin path in your local.xml file:
<admin>
    <routers>
        <adminhtml>
            <args>
                <frontName><![CDATA[adminpath]]></frontName>
            </args>
        </adminhtml>
    </routers>
</admin>
  1. You’ve tried various configurations in System -> Configuration -> Admin, changing the values for Custom Admin URL and Custom Admin Path.

However, none of these attempts seem to work correctly. The admin panel remains accessible from the default frontend URL even after following the Magento wiki guide you linked here.

The Correct Approach

The key issue lies in how Magento handles base URLs and domain configuration. To fix this, we need to make changes at the server level and within the Magento core.

Step 1: Base URL Setup

Ensure that your subdomain is correctly configured with its own separate base URL using a virtual host or similar setup on your server. The base URL should point directly to your Magento install directory.

For example, in Apache:

<VirtualHost *:80>
    ServerName   sub.domain.com
    DocumentRoot /var/www/html/magento-admin
</VirtualHost>

Step 2: Base URL Configuration

In the Magento admin panel (at your frontend domain), go to System -> Configuration -> General -> Web. Click on the Default Configurations link.

Under Unsecure Base URLs and Secure Base URLs, ensure that the values match your subdomain’s base URLs:

  • http(s)://sub.domain.com/
  • /adminpath/ (if you’ve set a custom admin path)

Step 3: Cookies Domain Configuration

Go to System -> Configuration -> General -> Web. Under Unsecure Base URLs and Secure Base URLs, in the Base URL field, click on the ”+” icon next to the field.

Enter the following values:

  • Scope: Global
  • Value: sub.domain.com
  • Path: /

Save your changes.

Step 4: Clear Cache

In the admin panel, go to System -> Cache Management. Select all cache types and click “Flush Magento Cache.”

Conclusion

Setting up a separate domain for the Magento admin interface requires a combination of server-level configuration and Magento-specific settings. By ensuring that your subdomain has its own base URL and adjusting the relevant Magento configurations as outlined above, you can successfully segregate your admin panel from your frontend.

Remember that security is paramount when dealing with admin interfaces. Always ensure that your credentials are strong and access to the admin area is restricted using proper firewall rules or network segmentation.

For more advanced configuration options and best practices for Magento installations, feel free to explore our comprehensive guides at Laravel Company.

Magento 1 Checkout Security Admin

Our network