We recursively determine the homotopy type of the space of any irreducible framed link in the 3-sphere, modulo rotations. This leads us to the homotopy type of the space of any knot in the solid torus, thus answering a question posed by Arnold. We similarly study spaces of unframed links in the 3-sphere, modulo rotations, and spaces of knots in the thickened torus. The subgroup of meridional rotations splits as a direct factor of the fundamental group of the space of any framed link except the unknot. Its generators can be viewed as generalizations of the Gramain loop in the space of long knots. Taking the quotient by certain such rotations relates the spaces we study. All of our results generalize previous work of Hatcher and Budney. We provide many examples and explicitly describe generators of fundamental groups.