An essential component of future quantum networks is an optical switch capable of dynamically routing single photons. Here we implement such a switch, based on a fiber-optical Sagnac interferometer design. The routing is implemented with a pair of fast electro-optical telecom phase modulators placed inside the Sagnac loop, such that each modulator acts on an orthogonal polarization component of the single photons, in order to yield polarization-independent capability that is crucial for several applications. We obtain an average extinction ratio of more than 19 dB between both outputs of the switch. Our experiment is built exclusively with commercial off-the-shelf components, thus allowing direct compatibility with current optical communication systems.