I'm trying to get the base url in a static block.

I've tried the following code:

<a href="{{base url=""}}../business">

I knew this wasn't going to work because it needs <?php ?> around it.
Is there an alternative way to get the base url in a static block through the backend?

Screenshot for clarification: enter image description here


You can get base url in static block like this.

<a href="{{store direct_url="business"}}">Your link</a>
| improve this answer | |
  • 1
    Using URL routing like this is always preferred over concatenating the URL. – Phil M Nov 30 '16 at 16:30

You can get it by {{config path="web/unsecure/base_url"}} and If you want to append another URL then you can do like

<a href="{{config path="web/unsecure/base_url"}}test213/32"> test </a>

If you want secure base URL then you can get it by

{{config path="web/secure/base_url"}}

| improve this answer | |

You can add store URL in static block:

<a href="{{store direct_url='identifier'}}">Your link</a>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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