Joomla to Wordpress redirections
Published:
Updated:
There are some good plugins to export Joomla content to WordPress. However, the free version does not rewrite the URIs. It is quite simple to read the Joomla database and generates a bunch of Apache Redirect directives.
As far as I understood, the URI of a post in Joomla is $pathOfMenu/$slugOfPost where $pathOfMenu is the path of the menu most specific menu associated with a category of the post.
The relevant SQL tables are:
joomla_categoriesfor the categories;joomla_menufor the menus;joomla_contentfor the posts.
For each post, we can generate an Apache Redirect directive as:
joomla_uri = "/" + menu_path + slug
wordpress_uri = row[:pub].strftime("/%Y/%m/%d/") + row[:alias] + "/"
puts ("RedirectPermanent "+joomla_uri + " " + wordpress_uri)