How to style text in hyperref \url?

I want to set color, font and similar style attributes for the text in a \url from the hyperref package. How do I go about doing it? All I have found are comments saying that I probably don't want to do that. I want to because I am using ttf fonts for my texts and I want my urls to be in that ttf and not the default (typewriter font?) that the hyperref package gives me. I started with just trying to get it in italics but didn't even succeed with that:

\documentclass{memoir}
\usepackage{hyperref}
\begin{document}
Lala \url{\itshape www.example.com}.
\end{document}


I am guessing there is some hook or something but I just can't find it. Maybe I have gone blind?

-
Related Question: How to get \url{} and \href{} displayed identically. –  Peter Grill Sep 20 '14 at 3:55

Internally \url uses \UrlFont. You can change it with \urlstyle (see the documentation of url in url.sty) or by redefining \UrlFont:

\documentclass{memoir}
\usepackage{hyperref,xcolor}

\begin{document}
Lala \url{www.example.com}.

\urlstyle{sf}
Lala \url{www.example.com}.

\renewcommand\UrlFont{\color{red}\rmfamily\itshape}
Lala \url{www.example.com}.
\end{document}

-
The package option urlcolor in the package hyperref does the same thing, i.e. \usepackage[urlcolor=red]{hyperref}. –  Ronny Oct 25 '12 at 13:02

Use \href instead:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\href{http://www.example.com}{\textit{www.example.com}}.
\end{document}


This takes two arguments: the first is the actual url, the second is the link text. The above code produces

-
Also, it seems to not change the font into that typewriter one but keeps happily running with my ttf font. :) –  jonalv Oct 26 '12 at 7:52