4 Ways to Get Magento Homepage URL

Here I comes with one more quick tip for Magento, earlier we have seen tips to detect the pages in Magento. In this article I would like to share 4 ways with which you can get home page URL in Magento.

Among these 4 methods, 3 can be used within the code and 1 method can be useful when you are dealing in admin panel CMS section for Static Blocks.

So let’s don’t waste time and have a look at the code snippets:

Option 1

echo $this->getUrl('');
echo $this->getUrl('');

Option 2

echo Mage::getBaseUrl();
echo Mage::getBaseUrl();

Option 3

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Option 4

This option will be used to get the home page URL in static blocks.

<a href="{{store url=""}}">Link to Homepage URL</a>

If you aware of any other method or ways to get home page URL in Magento then consider sharing to the world by placing the comment, Because Sharing is Caring.

If you don’t want to miss any upcoming article then subscribe to our RSS Feed via mail, Like us on Facebook or Follow us on Twitter. If you do so, I am sure you will never miss any article/freebies or updates from us.

Related Posts

Written by Avinash

Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.

View all posts by: