Solutions to nonlinear optimal control problems are usually computed in open-loop form, especially if the problem is subjected to state constraints. Open-loop controls, however, are not very useful from a control perspective due to their lack of robustness. We discuss a couple of useful techniques which reduce a state-constrained problem into an unconstrained problem, and subsequently apply a technique to synthesize an optimal state feedback controller for the reduced problem. The controller is able to recover the openloop optimal state and control for arbitrary initial conditions arising from a nontrivial subset of the state space, while ensuring that the state constraint is satisfied at all time.