Get the current post/page URL with plain permalinks

Is there a reason why get_permalink() doesn’t work for you? I’m unclear why you are trying to construct it manually.