Photonic switches are one kind of key devices in quantum optical networks and have been demonstrated previously through either manipulating the cavity-atom interactions [Phys. Rev. Lett. 111, 193601 (2013)] or driving the additional levels of the switch atoms [Phys. Rev. Lett. 106, 113601 (2011)]. In this paper, we propose an alternative configuration generated by three empty cavities coupled in series to serve as an ideal photonic switch of the photons along the waveguide, i.e., photons are completely transmitted (reflected) if the three cavities are (are not) exactly resonant. It is shown that the quality of such a detuning-sensitive photonic switch is insensitive to the cavity-cavity, cavity-waveguide, and cavity-atom coupling strengths. The feasibility of the devices is also demonstrated with the current waveguide photonic technique.