Skip to content Skip to sidebar Skip to footer

Magento get all URL paths

Reading Time: < 1 minute

Here,simple scripts to get store url, media url, skin url, site url, js url, current page url, site url in magento.You can use these methods in your phtml files in magento.

These all data get from Store.php file located in /Core/Model/Store.php

1- Get Store URL

  $storeURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

2- Get Skin URL

  $skinURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

3- Get Media URL

  $mediaURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

4- Get Direct Link

  $directLink = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);

5- Get Secure Base URL

  $secureBaseURL = Mage::getBaseUrl(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL);

6- Get JS URL

  $jsURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

7- Get Site URL

  $siteURL = Mage::helper('core/url')->getHomeUrl();

8- Get Current Page URL

  $currentPageURL = Mage::helper('core/url')->getCurrentUrl();