  Given a manifold $M$ and a proper sub-bundle $\Delta\subset TM$, we study
homotopy properties of the horizontal base-point free loop space $\Lambda$,
i.e. the space of absolutely continuous maps $\gamma:S^1\to M$ whose velocities
are constrained to $\Delta$ (for example: legendrian knots in a contact
manifold).
  A key technical ingredient for our study is the proof that the base-point map
$F:\Lambda \to M$ (the map associating to every loop its base-point) is a
Hurewicz fibration for the $W^{1,2}$ topology on $\Lambda$. Using this result
we show that, even if the space $\Lambda$ 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 $\Lambda$ (with
the $W^{1,2}$ topology) has the homotopy type of a CW-complex, that its
inclusion in the standard base-point 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 $\pi_k(\Lambda)\simeq \pi_k(M) \ltimes
\pi_{k+1}(M)$ for all $k\geq 0.$
  These topological results are applied, in the second part of the paper, to
the problem of the existence of closed sub-riemannian geodesics. In the general
case we prove that if $(M, \Delta)$ is a compact sub-riemannian manifold, each
non trivial homotopy class in $\pi_1(M)$ can be represented by a closed
sub-riemannian geodesic.
  In the contact case, we prove a min-max result generalizing the celebrated
Lyusternik-Fet theorem: if $(M, \Delta)$ is a compact, contact manifold, then
every sub-riemannian metric on $\Delta$ carries at least one closed
sub-riemannian geodesic. This result is based on a combination of the above
topological results with a delicate study of the Palais-Smale condition in the
vicinity of abnormal loops (singular points of $\Lambda$).
