A novel method for implementing header address recognition by using spectral-hologram-based correlator is proposed as a cost-effective way of realizing routing in internet protocol over photonic networks. Due to a difference of spectral response between commercially available holographic media and optical fibers, a second-harmonic optical header-address signal is generated and used both in the synthesis of the spectral hologram and in the recognition of the header addresses. The spectral hologram is employed to store the header addresses. The header-address recognition is performed by taking correlations between an incoming second-harmonic optical address and those stored in the spectral hologram. The system performance is analyzed.