In Magento I have a custom URL and path for admin.

The custom path it was set up in local.xml

<admin> <routers> <adminhtml> <args> <frontName>

And the custom URL on admin System > Config > Advanced > Admin > Admin Base URL

After that, the following lines are inserted in DB:


When I use <?php echo Mage::getBaseUrl(); ?> is returning base URL for links of custom admin (http://admin.mydomain.com/index.php/)

Because of this behavior, it puts URL admin in the cart and checkout.

  • I cannot reproduce the issue. Works fine here. Did you set up the base URLs for the default scope/frontend stores correctly?
    – mam08ixo
    Feb 19, 2016 at 13:02

1 Answer 1


The DB changes that you listed set the admin.mydomain.com as the secure and unsecure base_url. When you are calling the getBaseUrl function it is simply returning these values. In order to fix this issue you need to update the web/secure/base_url and web/unsecure/base_url back to what they should be (I am assuming something like www.mydomain.com). These values should be in the core_config table of your database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.