Fix URL when building with Cannonical ID

Used code from #235 by @nl0
Thank you for the contribution

Fixes #235