better handling of relative permalinks