diff --git a/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/portlet.js b/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/portlet.js
index 7ea111a069f8f6576430c089d24532cf070d32c8..d44eea9631f43c73d30abed36a3b1ccb16fa447c 100644
--- a/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/portlet.js
+++ b/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/portlet.js
@@ -335,7 +335,7 @@
 					instance.refreshLayout(portletBound);
 
 					if (window.location.hash) {
-						window.location.href = window.location.hash;
+						window.location.href = encodeURI(window.location.hash);
 					}
 
 					portletBoundary = portletBound;