diff --git a/qutebrowser/html/error.html b/qutebrowser/html/error.html
index b3e6f576e..e03ddad67 100644
--- a/qutebrowser/html/error.html
+++ b/qutebrowser/html/error.html
@@ -61,7 +61,7 @@ li {
{{ super() }}
function tryagain()
{
- location.href = "{{ url }}";
+ location.href = {{ url|tojson }};
}
{% endblock %}