Awhile vs. a while

Awhile is an adverb meaning for a while. It usually  follows a verb—for example:

Guests waited awhile for food … [Indie Wire]

When while does not mean the same as for a while, the phrase is two wordsa while—for example:

But if they give him The Tonight Show back, maybe it ends up all right after a while. [Hollywood.com]

When considering whether to use awhile, try replacing it with for a while. Would it make sense? If no, use a while. Try it with these examples:

The move has been anticipated for awhile … [iTWire]

Every once in awhile, even the best traveler needs to stop and ask for directions … [ABC News]

They thought for awhile that beta-carotene might help. [LA Times]

In each of these cases, awhile with for a while would create a nonsensical sentence, so the adverbial awhile should be changed to the two-word form.

The phrase awhile ago, technically meaning for a while ago, never makes logical sense.