27
Save your template, and you have successfully implemented redirection on your Blogger blog. However, you still need to setup your redirection on your WordPress site so that users are redirected to the proper posts. To do that, you need to create a new file using a plain text editor like Notepad. Give this file a name like wpb-blogger.php and paste this code inside it.
view sourceprint?
01
posts LEFT JOIN $wpdb->postmeta ".
13
"ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE ".
14
"$wpdb->postmeta.meta_key='blogger_permalink' AND ".
15
"$wpdb->postmeta.meta_value='$permalink[1]'";
16
$new_url = $wpdb->get_var($q)? $wpdb->get_var($q) : "/";
17
header ("HTTP/1.1 301 Moved Permanently");
18
header("Location: $new_url");
19
}
20
?>