We demonstrated the realization and characterization of a solid photonic bandgap fiber (SPBF) with a compact size of about 10 mm and a high wavelength sensitivity of up to −4.034 nm/°C by means of fully infiltrating an ultraviolet curable polymer with a high refractive index of 1.515 into air holes of a photonic crystal fiber (PCF). To the best of our knowledge, it was the first time that the SPBF with tunable bandgaps was fabricated in the conventional index-guiding PCF. Compared with conventional fluid filled PBFs, the proposed SPBF can be stable to temperature and other environmental effects and maintain a large extinction ratio of more than 30 dB within a broad wavelength. The splicing between the SPBF and single mode fibers has been solved. Moreover, it is observed that the bandwidth of bandgap (G2) gradually broadens with the increase in temperature.