I should also mention that the blog is about 2 years old and has almost 500 posts, so redirecting each one, individually would be way too time consuming.
I’ve heard of this problem a lot, but until now I’ve never heard a good solution. there may be one, but I’ve never heard of it
I have this very same problem, but no solution.
ABOVE your WordPress rules in your .htaccess
file, this will probably do I think:
RewriteEngine On
RewriteRule ^index.php/archives/(.+) http: //webfeedcentral.com/$1
(remove the space/line break after http:
)
That worked great, thank you so very much.
-Steve
Thank you for your help on this! I was starting to wonder if this was even possible.
Could I use this technique to change my old numerical permalinks (still hanging on from my the CMS I used before WordPress):
http://www.mothugg.se/item/737
to something fancier and SEO-friendlier like:
http://www.mothugg.se/fri-forskning-nastan-som-fildelning?
Or is there some plugin to do that?
Add this to the VERY top of your theme’s 404 page.
Change http://localhost/wordpress to your default wordpress folder.
This just does posts and possibly pages that end in the id (with or without the trailing url) Categories etc will have to be done elsewhere or by hand.
<?php
//Kinda obvious
$rf = $_SERVER[‘REQUEST_URI’];
$rf = explode(‘/’,$rf);
$last = count($rf);
//Filter out regular 404 that arn’t old urls
if(is_numeric($rf[$last-1])){
$post_id = $rf[$last-1];
}elseif(is_numeric($rf[$last-2])){
$post_id = $rf[$last-2];
}
// No sense loading WP if there isn’t an id
if ( $post_id ) {
// Oh fine we will load wordpress
define(‘WP_USE_THEMES’, false);
require(‘http://localhost/wordpress/wp-blog-header.php’);
$post = get_post($post_id);
//Well hope it is the right post. If not, ohwell. We tried.
if($post){
//Lets get the new URL
$new_link = get_permalink($post_id);
//We don’t want google to get angry with us.
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: $new_link”);
}
}
?>
Hello same here…
I want to change my permalinks from
http://www.enblogopedia.com/2007/02/10/what-ever/
to:
http://www.enblogopedia.com/what-ever/
isn’t redirecting through .htaccess better than the way “Ajd777” suggests ?!
I believe the code will be something like this:
RewriteEngine On
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+) http: //www.enblogopedia.com/$1
(of course with out the line break!)
Am I right?!