diff --git a/index.php b/index.php
index 105a04ad76e9e6d7de6f64ebf38f42ebf1b7b264..b1172382ec6de103fc16047f5fceb00dc05ba3a2 100644
--- a/index.php
+++ b/index.php
@@ -36,12 +36,12 @@ if(count($errors)>0){
 		exit();
 	}
 	else{
-		header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" ));
+		header( "Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" ));
 		exit();
 	}
 }else{
 	if( OC_USER::login( $_POST["user"], $_POST["password"] )){
-		header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" ));
+		header( "Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" ));
 		exit();
 	}
 	else{