An electromagnetically induced absorption grating is formed in a three-level atomic vapor under the condition of electromagnetically induced transparency in which the strong coupling beam is replaced by a standing wave. The transmission and reflection behaviors of the weak probe beam are greatly modified at certain frequencies near the two-photon resonance. An all-optical two-port signal router-all-optical switch is demonstrated.