diff --git a/packages/docusaurus-theme-search-algolia/src/index.js b/packages/docusaurus-theme-search-algolia/src/index.js
index 186857bd608c..ffc015b67600 100644
--- a/packages/docusaurus-theme-search-algolia/src/index.js
+++ b/packages/docusaurus-theme-search-algolia/src/index.js
@@ -59,8 +59,8 @@ function theme(context) {
path.join(outDir, OPEN_SEARCH_FILENAME),
renderOpenSearchTemplate({
title,
- url,
- favicon: normalizeUrl([url, favicon]),
+ url: url + baseUrl,
+ favicon: normalizeUrl([url, baseUrl, favicon]),
}),
);
} catch (err) {
diff --git a/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js b/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js
index adb802ee7e8d..1284223c7d47 100644
--- a/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js
+++ b/packages/docusaurus-theme-search-algolia/src/templates/opensearch.js
@@ -13,8 +13,8 @@ module.exports = `
Search <%= it.title %>
UTF-8
<%= it.favicon %>
-
-
+
+
<%= it.url %>
`;