Change permalinks config and legacy urls