Get base URL, Media URL, JS URL, Skin URL, Store URL, and Current URL

Basic Questions in magento’s developer mind when start theme development.

  • How to get Base URL in .phtml file.
  • How to get Skin URL in .phtml file.
  • How to display image in CMS page or Static Block.
  • How to get Media URL.
  • How to get JS URL.
  • How to get Store URL.
  • How to get Current URL.

Below are answer available for all above Questions.

Get URL in phtml files.

  1. Get Base Url :


  2. Get Skin Url :


    • Unsecure Skin Url :


    • Secure Skin Url :

      $this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

  3. Get Media Url :


  4. Get Js Url :


  5. Get Store Url :


  6. Get Current Url :


Get URL in static block or CMS page.

  1. Get Base Url :

    {{store url=""}}

  2. Get Skin Url :

    {{skin url='images/imagename.jpg'}}

  3. Get Media Url :

    {{media url='/imagename.jpg'}}

  4. Get Store Url :

    {{store url='mypage.html'}}