diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py
index aba061f87..516a885c3 100644
--- a/sphinx/builders/html/__init__.py
+++ b/sphinx/builders/html/__init__.py
@@ -1063,7 +1063,7 @@ class StandaloneHTMLBuilder(Builder):
if self.config.html_baseurl:
ctx['pageurl'] = posixpath.join(
- self.config.html_baseurl, pagename + self.out_suffix
+ self.config.html_baseurl, self.get_target_uri(pagename)
)
else:
ctx['pageurl'] = None