Bioinspired artificial nanochannels exhibiting ion transport properties similar to biological ion channels have been attracting some attention for biosensors, separation technologies, and nanofluidic diodes. Herein, an easily available artificial heterogeneous nanochannel shows both ion gating and ion rectification characteristics when irradiated by ultraviolet light. The fabrication of heterogeneous nanochannels includes the coating of an anatase TiO2 porous layer on an alumina porous supporter, followed by a chemical modification with octadecyltrimethoxysilane (OTS) molecules. The irreversible decomposition of OTS molecules by TiO2 photocatalysis under ultraviolet light results in a change of surface wettability and an asymmetric distribution of surface negative charges simultaneously, which contributes to the ion gating and ion rectification. The asymmetric distribution of negative charges in the TiO2 porous layer can be controlled by the irradiation time of ultraviolet light, which regulates the ion rectification characteristic.