This paper presents specific features of solitary wave dynamics within the framework of the Ostrovsky equation with variable coefficients in relation to surface and internal waves in a rotating ocean with a variable bottom topography. For solitary waves moving toward the beach, the terminal decay caused by the rotation effect can be suppressed by the shoaling effect. Two basic examples of a bottom profile are analyzed in detail and supported by direct numerical modeling. One of them is a constant‐slope bottom and the other is a specific bottom profile providing a constant amplitude solitary wave. Estimates with real oceanic parameters show that the predicted effects of stable soliton dynamics in a coastal zone can occur, in particular, for internal waves.