# Biblatex: redefine doi to display the full URL

I use the authoryear style for Biblatex. For articles that have a DOI, biblatex+biber automatically produce the following in the bibliography:

DOI : 10.1162/qjec.2008.123.1.49

which contains a hyperref link to : https://doi.org/10.1162/qjec.2008.123.1.49

I would like to know how to change the style so that the DOI would also display the full link, that is, that it would display:

and still link to the same URL https://doi.org/10.1162/qjec.2008.123.1.49

Thank you!

MWE:

\documentclass{article}
\usepackage{hyperref}

\usepackage[%url=false,eprint=false,
style=authoryear,  backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{GabaixLandier_2008,
author               = {Gabaix, Xavier and Landier, Augustin},
doi                  = {10.1162/qjec.2008.123.1.49},
journal              = {The Quarterly Journal of Economics},
number               = {1},
pages                = {49-100},
title                = {Why has CEO Pay Increased So Much?},
volume               = {123},
year                 = {2008},
}
\end{filecontents}

\begin{document}

\section{Introduction}
Dummytext~\autocite{GabaixLandier_2008}.

\printbibliography
\end{document}


Add the following to your preamble after loading biblatex:

\DeclareFieldFormat{doi}{%

\DeclareFieldFormat{doi}{\mkbibacro{DOI}\addcolon\space\url{https://doi.org/#1}}

• @AlanMunn I prefer my solution because I don't have to go into an \if... branch that essentially does the same for both cases. – moewe Apr 12 '17 at 16:01