Synthesis of functionalized quinolines and benzo[c][2,7]naphthyridines based on a photo-Fries rearrangement.