A method for construction of exact solutions to the nonlinear heat equation u t = (F (u)u x) x + G (u)u x + H (u), which is based on the ansatz p(x) = ω 1 (t) φ(u) + ω 2 (t), is proposed. The function p(x) is a solution of the equation (p′) 2 = Ap 2 + B, and the functions ω 1 (t), ω 2 (t) and ϕ(u) can be found from the condition that this ansatz reduces the nonlinear heat equation to a system of two ordinary differential equations with unknown functions ω 1 (t) and ω 2 (t).