diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 085f53945a6c32219454e8823b195971ca1367ff..0c672cd6708c28dbe7bcb0df87444030815c2b0a 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -163,7 +163,7 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio
 });
 
 FileActions.register('dir','Open','',function(filename){
-	window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+	window.location=OC.linkTo('files', 'index.php') + '&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 });
 
 FileActions.setDefault('dir','Open');
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 31fb5f892e44424f95135ef7e4b3de5b7d74b06f..e6a9a6883af8e7bec9d0f3bcb2b9b48ddb5fbcf0 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -41,7 +41,7 @@ FileList={
 		html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name});
 		td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
 		td.append('<input type="checkbox" />');
-		var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
+		var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"&dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
 		link_elem.append($('<span></span>').addClass('nametext').text(name));
 		link_elem.append($('<span></span>').attr({'class': 'uploadtext', 'currentUploads': 0}));
 		td.append(link_elem);
@@ -56,7 +56,7 @@ FileList={
 		modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
 		td = $('<td></td>').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize);
 		html.append(td);
-		
+
 		td = $('<td></td>').attr({ "class": "date" });
 		td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) ));
 		html.append(td);
diff --git a/apps/files_archive/js/archive.js b/apps/files_archive/js/archive.js
index 531eb61c01af4fc60150699d110e21249e306c11..9fb9853e299e3fde320a51cb9ca167bdbbbfacb1 100644
--- a/apps/files_archive/js/archive.js
+++ b/apps/files_archive/js/archive.js
@@ -8,11 +8,11 @@
 $(document).ready(function() {
 	if(typeof FileActions!=='undefined'){
 		FileActions.register('application/zip','Open','',function(filename){
-			window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+			window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 		});
 		FileActions.setDefault('application/zip','Open');
 		FileActions.register('application/x-gzip','Open','',function(filename){
-			window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+			window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 		});
 		FileActions.setDefault('application/x-gzip','Open');
 	}