Is there a way to change login page URL in Magento?

Is there a way to change login page URL in Magento?

August 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Is there a way to change login page URL in Magento?

Changing Customer Login URL in Magento

As an e-commerce store owner on Magento, you might want to customize your website’s URLs for better branding or SEO purposes. One common request is to change the default customer login URL from www.mydomain.com/customer/account/login/ to something more concise like www.mydomain.com/login. In this post, we’ll guide you through the steps to achieve this customization.

Understanding the Default Magento URL Structure

By default, Magento uses the following URLs for customer account pages:

  • Login: www.mydomain.com/customer/account/login/
  • Create Account: www.mydomain.com/customer/account/create/
  • Forgot Password: www.mydomain.com/customer/account/forgotpassword/

These URLs are generated based on the customer route defined in the app/code/core/Mage/Customer/controllers/AccountController.php file. The URL structure is controlled by the Mage_Core_Controller_Varien_Router_Standard::addRoute() method, which maps customer/* to the account/ controller.

Changing the Login URL

To change the login URL from /customer/account/login/ to /login/, you need to override this route and create a custom one. Here’s how to do it:

  1. Create a new module (if you don’t have one already). In your Magento root directory, navigate to app/code/local (or app/code/community for Magento versions before 1.4) and create a new folder with your desired namespace, e.g., Your_Company_CustomUrl.

  2. Create the config.xml file in the following path: Your_Company/CustomUrl/etc/config.xml. Add the following content:

<?xml version="1.0"?>
<config>
    <modules>
        <Your_Company_CustomUrl>
            <version>0.1.0</version>
        </Your_Company_CustomUrl>
    </modules>
    <global>
        <router>
            <route url="/login" module="customer">
                <frontName>your_custom_login_url</frontName>
            </route>
        </router>
    </global>
</config>

Replace Your_Company with your actual namespace and your_custom_login_url with the desired front name for the login URL.

  1. Clear the cache to apply the changes:
  • Navigate to System > Cache Management in your Magento admin panel.
  • Select all cache types and click “Flush Cache” or “Flush Magento Cache”.

Verifying the Changes

After following these steps, you should see that the customer login URL has been changed from /customer/account/login/ to /login/. If you need to change other account URLs like create account or forgot password, repeat the process with appropriate routes and front names.

Remember, it’s always a good practice to keep track of your customizations in separate modules to ensure they don’t get overwritten during Magento updates. For more advanced custom URL structures, consider using rewrite rules or URL rewrites in the admin panel (System > Configuration > General > Web).

If you’re looking for professional Magento development services or need help with more complex URL routing, feel free to reach out to Laravel Company. Our experienced team can assist you with all your Magento customization needs.

Extensions Configuration Customers SEO

Our network