Index: wp-includes/default-filters.php
===================================================================
--- wp-includes/default-filters.php	(revision 5768)
+++ wp-includes/default-filters.php	(working copy)
@@ -183,5 +183,6 @@
 add_action('init', 'smilies_init', 5);
 add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
 add_action( 'shutdown', 'wp_ob_end_flush_all', 1);
+add_action( 'parse_request', 'canonical_trailing_slash');
 
 ?>
\ No newline at end of file
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 5768)
+++ wp-includes/functions.php	(working copy)
@@ -1317,4 +1317,20 @@
 	while ( @ob_end_flush() );
 }
 
+function canonical_trailing_slash( $request ) {
+	if ( ! $request->did_permalink )
+		return;
+
+	if ( !empty($request->query_vars['error']) )
+		return;
+
+	$req = $_SERVER['REQUEST_URI'];
+	$req = user_trailingslashit($req);
+	if ( $req == $_SERVER['REQUEST_URI'] )
+		return;
+
+	wp_redirect($req, '301');
+	exit;
+}
+
 ?>
