  We perform the dimensional reduction of the spacetime of a stack of N
D3-branes by the ``twist'' identification of a circle to obtain a new Melvin
background. In the near-horizon limit the background becomes the magnetic-flux
deformed $AdS_5 \times S^4$ or $AdS_4 \times S^5$ spacetime. After analyzing
the classical closed string solutions with several angular momenta in different
directions of the deformed spacetimes we obtain two string solutions. The first
solution describes a circular closed string located at a fixed value of
deformed $AdS_5$ radius while rotating simultaneously in two planes in deformed
$AdS_5$ with equal spins $S$. The second solution describes a string rotating
in deformed $S^5$ with two equal angular momenta $J$ in the two rotation
planes. We investigate the small fluctuations therein and show that the
magnetic fluxes have inclination to improve the stability of these classical
string solutions.
