In this study, we report a histidine-based fluorescence probe for Cu2+ and Hg2+, in which the amino group and imino group were modified by two common protective groups, 9-fluorenylmethoxycarbonyl and trityl group, respectively. In a water/methanol mixed solution, the probe displayed a selective fluorescence “turn-off” response to Cu2+ when the ratio of CH3OH/H2O was higher than 1:1. Specifically, when the solvent is changed to 1:1 methanol/water, the 304 nm fluorescence peak is enhanced, while the 317 nm peak is weakened, upon addition of either Cu2+ or Hg2+ ions. The mechanism for such distinct responses of the probe to Cu2+ and Hg2+ was further clarified by using NMR and molecular simulation. The experiment results indicated that the polarity of solvent could influence the coordination mode of 1 with Cu2+ and Hg2+, and control the fluorescence response as a “turn-off” or ratiometric probe.