Create link to root URL


I’m having problem linking to the root URL in a live server but on my dev environment it works fine. I’m using:

<?php echo $this->createUrl('/');?>

This works fine on my localhost but on the live server it just links to the current URL. Any ideas why? I’ve tried various things. I added a URL manager rule:

'/' => 'site/index'

but this doesn’t seem to work.


You should create the url using site/index.

The url rules will rewrite it to ‘/’.

Hi jacmoe,

That’s great, thanks.