Docly Developers
GuideUpdated 18 Oct 2026

Prevent Docly changing HREF and SRC

When a site is published under a sub path (for example /shop), Docly rewrites root-relative references in the output so they point into the site: src="/, srcset="/, href="/ and CSS url(/, url('/ and url("/. Only double-quoted attributes are rewritten. A site published at the domain root is left unchanged.

Specify a \ in front of your value

See examples:

<a href="\/">This will always point at http://domain/</a>
<a href="\/News">This will always point at http://domain/News</a>

This always takes the picture from the site root:
<img src="\/image.jpg" />

The \ escape works in double-quoted href and src attributes only. Docly removes the \ in the output.

This should only be done in your personal templates. When you are making templates to be used by others or in multiple sites, this is never a good idea.