TCH-Tim Posted April 5, 2005 Posted April 5, 2005 I recently moved from Moveable Type to WordPress, mostly just because I wanted to try it out, and everything went very smooth. Didn't take very long at all to install WP and export/import all my MT entries. The problem I just realized today is that Google and others have indexed many of my old MT posts and I would like them to continue pointing people my way. If I delete the posts, people will get a 404 error. If I leave the posts, people will comment on the MT post instead of the WP mirror (which is what happened this morning), and I'll have two commenting systems going. (I could occasionally export/import the MT stuff into WP as a temporary workaround, but that's kind of silly.) So the question, what to do with my 6 months worth of MT posts? Is there something that can index all my old MT URLs and automatically redirect people to the corresponding WP entry? -Tim Quote
TweezerMan Posted April 5, 2005 Posted April 5, 2005 One way is to use an MT index template to generate .htaccess 'Redirect permanent' directives for your old MT entry permalinks. Required: the DirifyPlus plugin. In MT, create a new index template. The Template Name and Output File aren't really important because you're just going to use this temporarily. You could use "Redirect to WP" for the name, and "redirects.html" for the Output File Name, for example. Copy the following code and paste it into the Template Body: ><MTEntries lastn="99999"> Redirect permanent /mt/archives/<$MTEntryDate format="%Y/%m"$>/<$MTEntryBasename$>.php http://www.garduque.net/wp/<$MTEntryDate format="%Y/%m/%d"$>/<$MTEntryTitle dirifyplus="pld"$>/<br /> </MTEntries> Save the template, then rebuild it. Go to 'redirects.html' in your browser and you should see the generated directives. Copy and paste them into your .htaccess file (I'd recommend the .htaccess file in your public_html directory). The list of Redirect directives should be checked to ensure that both the MT URLs and the WP URLs are correct - there may be a few cases where the logic does not generate the correct URL. I've taken an educated guess on the code above, using the permalinks on both your MT and WP pages as a guide. Once you're satisfied with the list of Redirect directives and have placed them into your .htaccess file, you can delete the Index template if you wish. Regular visitors and search engines that hit your old MT entries should now be redirected to your new WP pages. Hope this helps... Quote
TCH-Tim Posted April 6, 2005 Author Posted April 6, 2005 That, sir, is exactly what I was looking for and took maybe five minutes to do. Google is telling me it works. Thanks much. -Tim Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.