How do I stop my relative links to stylesheets breaking? When I navigate to [home]/news/2014/poster my relative links to stylesheets break. I am using:

&lt;link href="css/myStylesheet.css" rel="stylesheet"&gt;


How do I stop these links breaking in this scenario?
The links aren't working because that's a relative URL, from whatever the last "directory"-looking segment in your page's URL is.

To resolve this, you can either make your URLs root-relative:

&lt;link href="/css/myStylesheet.css" rel="stylesheet"&gt;


Or relative to the site URL:

&lt;link href="{{ siteUrl }}css/myStylesheet.css" rel="stylesheet"&gt;


The drawback to root-relative URLs is, it makes your site a little less portable - you'll only be able to install the site in a web root (no subfolders) without having to update all URLs.

If this is a localized site with multiple site URLs, then both solutions could have issues. In that case it might make sense to define your own custom config setting in craft/config/general.php:

'baseResourceUrl' =&gt; "http://example.com/",


Then call glad from your templates instead of siteUrl:

&lt;link href="{{ craft.config.baseResourceUrl }}css/myStylesheet.css" rel="stylesheet"&gt;