Given a manifold M and a proper sub-bundle ∆ ⊂ T M , we investigate homotopy properties of the horizontal free loop space Λ, i.e. the space of absolutely continuous maps γ : S 1 → M whose velocities are constrained to ∆ (for example: legendrian knots in a contact manifold).In the first part of the paper we prove that the base-point map F : Λ → M (the map associating to every loop its base-point) is a Hurewicz fibration for the W 1,2 topology on Λ. Using this result we show that, even if the space Λ might have deep singularities (for example: constant loops form a singular manifold homeomorphic to M ), its homotopy can be controlled nicely. In particular we prove that Λ (with the W 1,2 topology) has the homotopy type of a CW-complex, that its inclusion in the standard free loop space (i.e. the space of loops with no non-holonomic constraint) is a homotopy equivalence, and consequently its homotopy groups can be computed as π k (Λ) ≃ π k (M ) ⋉ π k+1 (M ) for all k ≥ 0.In the second part of the paper we address the problem of the existence of closed subriemannian geodesics. In the general case we prove that if (M, ∆) is a compact sub-riemannian manifold, each non trivial homotopy class in π 1 (M ) can be represented by a closed subriemannian geodesic.In the contact case, we prove a min-max result generalizing the celebrated Lyusternik-Fet theorem: if (M, ∆) is a compact, contact manifold, then every sub-riemannian metric on ∆ carries at least one closed sub-riemannian geodesic. This result is based on a combination of the above topological results with the delicate study of an analogous of a Palais-Smale condition in the vicinity of abnormal loops (singular points of Λ).