xurl
Long URLs may break after any character (and at hyphens), so they no longer run into the margin.
- Preamble
% Links behave as they should. Enables "\url{...}" for URL typesettings.
% Allow URL breaks also at a hyphen, even though it might be confusing: Is the "-" part of the address or just a hyphen?
% See https://tex.stackexchange.com/a/3034/9075.
\usepackage[hyphens]{url}
% When activated, use text font as URL font, not the monospaced one.
% For all options see https://tex.stackexchange.com/a/261435/9075.
% \urlstyle{same}
% Allow URL breaks after any character, so that long URLs do not run into the margin.
% Loaded before biblatex, so that the biblatex settings of the URL penalties stay.
% See https://ctan.org/pkg/xurl.
\usepackage{xurl}
% nicer // - solution by http://tex.stackexchange.com/a/98470/9075
% DO NOT ACTIVATE -> prevents line breaks
%\makeatletter
%\def\Url@twoslashes{\mathchar`\/\@ifnextchar/{\kern-.2em}{}}
%\g@addto@macro\UrlSpecials{\do\/{\Url@twoslashes}}
%\makeatother