diff --git a/.htaccess b/.htaccess
index 4837df6adbe6d9fe4570c127b2cf56db869fbd20..df074f7f80681155f37f7560fd764bc496aac6b8 100644
--- a/.htaccess
+++ b/.htaccess
@@ -62,8 +62,8 @@
 
   # Rewrite rules for `front_controller_active`
   Options -MultiViews
-  RewriteRule ^core/js/oc.js$ index.php/core/js/oc.js [PT,E=PATH_INFO:$1]
-  RewriteRule ^core/preview.png$ index.php/core/preview.png [PT,E=PATH_INFO:$1]
+  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
+  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
   RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
   RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
   RewriteCond %{REQUEST_FILENAME} !/remote.php
diff --git a/lib/base.php b/lib/base.php
index 7659148c14084d62ab85bdc27abbfac78855687d..16db8f4dcd2db62e2503cfe444e8aa4553ab9aac 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -823,7 +823,7 @@ class OC {
 		}
 
 		$request = \OC::$server->getRequest();
-		$requestPath = $request->getPathInfo();
+		$requestPath = $request->getRawPathInfo();
 		if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
 			self::checkMaintenanceMode();
 			self::checkUpgrade();