The optimal pointwise control of the KdV equation is investigated with an objective of minimizing a given performance measure. The performance measure is specified as a quadratic functional of the final state and velocity functions along with the energy due to open- and closed-loop controls. The minimization of the performance measure over the controls is subjected to the KdV equation with periodic boundary conditions and appropriate initial condition. In contrast to standard optimal control or variational methods, a direct control parameterization is used in this study which presents a distinct approach toward the solution of optimal control problems. The method is based on finite terms of Fourier series approximation of each time control variable with unknown Fourier coefficients and frequencies. He's variational iteration method for the nonlinear partial differential equations is applied to the problem and thus converting the optimal control of lumped parameter systems into a mathematical programming. A numerical simulation is provided to exemplify the proposed method.