Ship detection in heavy sea clutter is a big challenge for over-the-horizon (OTH) radar. Wideband signal is helpful for improving range resolution and the signal-to-clutter ratio. In this paper, to support OTH radar employing wideband in cochannel interference, we propose environmental sensing-based waveform (ESBW) strategy, by considering transmit waveform design as an active approach and cognitive loop for the time-varying environment. In ESBW strategy, OTH radar monitors the environment in real time, estimates interference characteristics, designs transmit waveform adaptively, and employs traditional signal processing structure to detect targets in the presence of interference. ESBW optimization problem employs the criteria of maximizing the output signal-to-interference-plus-noise ratio (SINR) of matched filter and similarity constraint for reasonable range resolution and sidelobe levels. The analytic solution to this constrained problem is developed, so that ESBW design algorithm's efficiency is guaranteed, with adjustable SINR and autocorrelation function. A simulated scenario with strong interference and colored noise has been introduced. Simulation results demonstrate that OTH radar with ESBW strategy detects the target successfully in the background of cochannel interference.