  Let $p_n(x)$, $n=0,1,\dots$, be the orthogonal polynomials with respect to a
given density $d\mu(x)$. Furthermore, let $d\nu(x)$ be a density which arises
from $d\mu(x)$ by multiplication by a rational function in $x$. We prove a
formula that expresses the Hankel determinants of moments of $d\nu(x)$ in terms
of a determinant involving the orthogonal polynomials $p_n(x)$ and associated
functions $q_n(x)=\int p_n(u) \,d\mu(u)/(x-u)$. Uvarov's formula for the
orthogonal polynomials with respect to $d\nu(x)$ is a corollary of our theorem.
Our result generalises a Hankel determinant formula for the case where the
rational function is a polynomial that existed somehow hidden in the folklore
of the theory of orthogonal polynomials but has been stated explicitly only
relatively recently (see [arXiv:2101.04225]). Our theorem can be interpreted in
a two-fold way: analytically or in the sense of formal series. We apply our
theorem to derive several curious Hankel determinant evaluations.
