Index: /CKTester/fort.js
===================================================================
--- /CKTester/fort.js	(revision 4142)
+++ /CKTester/fort.js	(revision 4143)
@@ -50,6 +50,6 @@
 			}
 
-			var url = window.location.href,
-				baseUrl = url.substr( 0, url.indexOf( '?' ) ),
+			var url = window.location.href;
+			var baseUrl = url.substr( 0, url.search( /[^\/\\]*\.\w+(:?$|\?)/ ) ),
 				query = window.location.search, match,
 				// Receive 'profile','variables' and 'criteria' from URL parts.
@@ -281,6 +281,6 @@
 				normalizePath = function ( path )
 				{
-					// Always start with backslash.
-					return path.replace( /^([^\/\\])/, '/$1' );
+					// Always start with backslash and end with no slashes.
+					return path.replace( /^[^\/\\]/, '/$&' ).replace( /[\/\\]+$/,'' );
 				},
 				pathA = normalizePath( pathA ).split( deliminator ),
