A N‐2‐phenylethyl‐substituted 1,4‐dihydropyridine derivative (NDHP) containing 5,5‐dimethylcyclohexane‐1,3‐dione and naphthylethylene was designed and synthesized. NDHP acts as a multifunctional fluorescent sensor in dual phases. The crystal structure analysis confirms that the NDHP molecules have highly twisted conformations. The twisted conformation results in aggregation‐induced emission properties and solid‐state emission, by restricting the intramolecular free rotation in the aggregated or solid state. In the solid state, NDHP exhibits reversible mechanochromic properties as a result of the transition between the amorphous and crystalline states. NDHP also exhibits a rare phenomenon of acid‐fumed solid‐state emission enhancement owing to the change in packing mode from a zigzag arrangement to J‐aggregation. The solid‐state stimuli‐responsive fluorescence switching is applied to realize a rewritable optical recording media and a multiple output combinational logic system. In solution, NDHP shows a selective fluorescence response for environmentally harmful Hg2+, with a limit of detection of 2.7 nm. This results from the “turn‐on” responsive behavior owing to the Hg2+‐triggered aggregation of the NDHP molecules. NDHP is also used in the imaging of intracellular Hg2+ in HeLa cells. These findings provide a feasible and attractive route for developing multifunctional fluorescent sensors for use in dual phases.