This is a confusion I've had for quite sometimes, first when learning about equilibria (due to contradicting teachers), then when trying to teach it (due to contradicting sources, in books and on the Internet).
When facing an equilibrium (let's be original and take $\ce{a A + b B <=> c C + d D}$ as an example), the equilibrium constant is $$K = \frac{a(\ce{C})^c \cdot a(\ce{D})^d}{a(\ce{A})^a \cdot a(\ce{B})^b}$$ where $a(\ce{X})$ is the activity of X.
For pure solids, the activity is 1; therefore solids "do not appear" in the expression of the constant. For dilute solutions, the activity of the solute can be taken as its molar concentration. Thus, supposing A, B, C and D are not solids, the equilibrium constant can be written as
$$ K_c = \frac{[\ce{C}]^c [\ce{D}]^d}{[\ce{A}]^a [\ce{B}]^b}$$
But what happens when facing liquids (e. g. water)? In that case, I have seen two things :
Just putting the "concentration" of the liquid into the equilibrium constant.
A pure (or nearly pure, such as the solvant in a dilute solution) liquid has an activity of (or nearly of) 1. Therefore, the liquid should not appear in the constant.
Let's apply both cases to acidity constants, for the reaction $\ce{HA + H2O <=> A- + H3O+}$.
- As $[\ce{H2O}] \approx 55.55$ mol/l in dilute solutions, $$K_c = \frac{[\ce{A-}][\ce{H3O+}]}{[\ce{HA}][\ce{H2O}]} \textrm{ and } K_a = \frac{K_c}{[\ce{H2O}]} = \frac{[\ce{A-}][\ce{H3O+}]}{[\ce{HA}]}$$
- As $a(\ce{H2O}) \approx 1$ in dilute solutions, $$K_a = K_c = \frac{[\ce{A-}][\ce{H3O+}]}{[\ce{HA}]}$$
Which way is correct? I'd be more inclined to follow the option #2, but I've been stared at wide-eyed like a heretic when talking about that.