In this work, a highly sensitive and stable sensing scaffold consisting of gold nanoparticle-encapsulated TiO2 nanotubes, the hydrophilic ionic liquid, 1-decyl-3-methylimidazolium bromide, and Nafion was developed for the fabrication of electrochemical enzyme biosensors. A significant aspect of our work is the application of 12-phosphotungstic acid as both a highly localized photoactive reducing agent to deposit well-dispersed gold nanoparticles on TiO2 nanotubes and an electron mediator to accelerate the electron transfer between an enzyme and the electrode. After characterizing the nanocomposite component of the scaffold by Fourier transform infrared spectroscopy, X-ray diffraction and transmission electron microscopy, thiolated horseradish peroxidase (as a model enzyme) was immobilized on the scaffold and the biosensor was applied to the detection of H2O2. The direct electron transfer between the enzyme and the electrode was promoted by the excellent biocompatibility and conductivity of the scaffold. In addition, a thiolated enzyme has significantly improved the stability and direct electron transfer of horseradish peroxidase on the biosensor, which could be ascribed to the strong affinity between the sulfhydryl group on the enzyme and gold nanoparticles on the biosensor surface. Cyclic voltammetry, chronoamperometry, and square wave voltammetry were used to study the electrochemistry and analytical performance of the biosensor. A dynamic range from 65 to 1600 μM, a limit of detection of 5 μM, and a sensitivity of (18.1 ± 0.43) × 10-3 μA μM-1 H2O2 were obtained. The sensing scaffold based on the nanocomposite was demonstrated to be effective and promising in developing enzyme biosensors.