Corrects URI structure for permalinks