diff --git a/src/invidious/views/components/video-context-buttons.ecr b/src/invidious/views/components/video-context-buttons.ecr
index 062c3de0..daa107f0 100644
--- a/src/invidious/views/components/video-context-buttons.ecr
+++ b/src/invidious/views/components/video-context-buttons.ecr
@@ -8,7 +8,7 @@
<% if env.get("preferences").as(Preferences).automatic_instance_redirect%>
- " href="/redirect?referer=%2Fwatch<%=endpoint_params%>">
+ " href="/redirect?referer=%2Fwatch<%=URI.encode_www_form(endpoint_params)%>">
<% else %>