--- colorbox_node.js	2014-10-22 21:32:43.000000000 +0200
+++ /tmp/colorbox_node.js	2014-11-26 14:02:46.000000000 +0100
@@ -56,7 +56,8 @@
 
         // Lets add our colorbox link after the base path if necessary.
         var base_path = Drupal.settings.basePath;
-        var pathname = parse.pathname;
+	var path_prefix = Drupal.settings.pathPrefix;
+	var pathname = parse.pathname;
 
         // Lets check to see if the pathname has a forward slash.
         // This problem happens in IE7/IE8
@@ -68,15 +69,15 @@
         var url = $.getParameterByName('q', href);
         if (base_path != '/') {
             if (url != '') {
-                var link = pathname.replace(base_path, base_path + '?q=colorbox/') + url;
+                var link = pathname.replace(base_path, base_path + parse.search.replace('?q=', '?q=/' + path_prefix + 'colorbox/'));
             } else {
-                var link = pathname.replace(base_path, base_path + 'colorbox/') + parse.search;
+                var link = pathname.replace(base_path, base_path + path_prefix + 'colorbox/') + parse.search;
             }
         } else {
             if (url != '') {
-                var link = base_path + '?q=colorbox' + pathname + url;
+                var link = base_path + parse.search.replace('?q=', '?q=/' + path_prefix + 'colorbox/');
             } else {
-                var link = base_path + 'colorbox' + pathname + parse.search;
+                var link = base_path + path_prefix + 'colorbox' + pathname + parse.search;
             }
         }
 
