Fix issue with pretty permalinks disabled