Ferroelectric photonic band-gap (PBG) structures are fabricated by the infiltration of sodium nitrite into the nanoporous silicon templates composed by the electrochemical etching of n-type silicon. Reversible spectral tuning of the PBG and of the microcavity mode up to 15 nm is attained in the temperature interval from 50 to 165 degrees C due to the temperature changes of the refractive index of sodium nitrite in nanoporous silicon matrix. Optical second-harmonic generation measurements prove the ferroelectric state of the composed nanocomposite PBG structures. (c) 2007 American Institute of Physics.