To improve the extraction performance and mechanical property, a bipyridyl ionic liquid-hybridized silica aerogel was synthesized, and explored as the solid-phase microextraction (SPME) coating. Due to the embedding of the bipyridyl ionic liquid in silica aerogel via the covalent bond, the hybridized material not only provided the three-dimensional and porous structure of the aerogel, and it also possessed good extraction performance of the ionic liquid. Based on the π–π interaction between the aerogel and polycyclic aromatic hydrocarbons (PAHs), PAHs were selected as model analytes. The main parameters including extraction time, extraction temperature, ionic strength, stirring rate and desorption time were investigated and optimized, through coupling the SPME fiber with gas chromatography. Under the optimized conditions, the analysis method was established. The linear ranges of 0.015–20 and 0.03–30 μg L−1 and the correlation coefficients of 0.9981–0.9998 were obtained. The limits of detection and the limits of quantification were 0.005–0.01 μg L−1 and 0.015–0.03 μg L−1, respectively. The method was applied to the detection of PAHs in aqueous solutions of cigarette gas and residual cigarette ash. All targets were detected and it could be known that there were more PAHs in cigarette gas than that in cigarette ash.