diff --git a/core/js/lostpassword.js b/core/js/lostpassword.js
index 35173fd3d33f9388028f00fc563d30a2f8a07315..294a9d8c1cf6e430a36eda89beccacfcf17d485e 100644
--- a/core/js/lostpassword.js
+++ b/core/js/lostpassword.js
@@ -112,7 +112,11 @@ OC.Lostpassword = {
 	},
 
 	redirect : function(msg){
-		window.location = OC.webroot;
+		if(OC.webroot !== '') {
+			window.location = OC.webroot;
+		} else {
+			window.location = '/';
+		}
 	},
 
 	resetError : function(msg){