Unsaturated γ-hydroxy ketones 3 and γ-hydroxy nitriles 7 are readily converted into 4-oxo esters 4 and 3-cyano esters 8 by means of a Claisen−Johnson orthoester rearrangement, using triethyl orthoacetate in xylene at reflux. The obtained ester derivatives can be selectively reduced at the carbonyl and cyano groups to afford the corresponding lactones 5 and pyrrolidinones 14.