Glyphosate, the most used herbicide in the world, has a residue problem that cannot be ignored. However, glyphosate itself does not have fluorescence emission and lacks the conditions for fluorescence detection. In this work, a rapid and selective fluorescence detection method of glyphosate was designed by an "on-off-on" fluorescent switch based on luminous covalent organic framework (L-COF). Only the fixed concentration of Fe3+ as intermediate could trigger the fluorescent switch and no incubation step was required. The proposed method showed good accuracy with correlation coefficient of 0.9978. The method's limits of detection and quantitation were 0.88 and 2.93 μmol/L, which were lower than the maximum allowable residue limits in some regulations. Environmental water samples and tomatoes were selected as actual samples to verify the application in complex matrix. A satisfactory mean recovery from 87% to 106% was gained. Furthermore, Fe3+ could induce fluorescence quenching of L-COF through photo-induced electron transfer (PET) effect, while the addition of glyphosate could block PET effect to achieve the detection. These results demonstrated the proposed method had abilities to detect glyphosate, and broadened the application of L-COF.