Download & Extend

Support path_redirect for imported Wordpress path aliases

Project:Wordpress Import
Version:6.x-2.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Rather than using the path.module, it would be nice to have the option to use the path_redirect module to 301 redirect the old Wordpress path to Drupal's new path.

My particular reason to wanting this feature is so that my imported blog could adhere to the pathauto rules I setup. I'd like my imported content to have the same URL structure as my new content.

Comments

#1

Attached is a patch. Please note that the use of path_redirect is set to be the default if path_redirect is enabled and pathauto is enabled. The reason behind this is that I assume that if you have both enabled, you'd like to 301 redirect your wordpress URLs to new, Drupal pathauto urls. You may wish to amend this patch to make using path_redirect an option when starting the import.

AttachmentSize
wordpress_import-868068.patch 1.72 KB

#2

Tested.. seems to work here. I did make a small change to make it PHP5 compatible.

path_redirect_save($path = array('source' => $redirect_path, 'redirect' => 'node/'. $node->nid));
AttachmentSize
wordpress_import.patch 1.77 KB