Importing Wordpress permalinks into Drupal path aliases doesn't always work

lavamind - November 6, 2009 - 18:03
Project:Wordpress Import
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:lavamind
Status:needs work
Description

It seems that when the link posts in the WXR file are in the "ugly" permalink format (the default setting, see http://codex.wordpress.org/Using_Permalinks#Default:_.22Ugly.22), importing with alias creation doesn't work.

See this forum post : http://drupal.org/comment/reply/576858/2187408#comment-2187408

I'm not sure if this can be solved because I don't think Drupal path aliases can replicate Wordpress' "ugly" permalink format. This option works better for Wordpress sites that have activated "pretty" permalinks, ie without "p?=" in the URL.

Needs to be investigated...

#1

lavamind - November 10, 2009 - 20:44

#2

milehighlife - November 18, 2009 - 20:14

Has anyone successfully used Wordpress Import to alias the ugly permalinks?

#3

lavamind - November 19, 2009 - 05:11

This issue is under discussion between the other maintainer and myself.

One solution would be to create a modified alias in Drupal, importing ?p=[id] as something like p/[id], and then a small snippet in Drupal's .htaccess to translate the Wordpress-style ugly permalink into the pretty Drupal alias. That snippet would need to be manually added by the user though, as I simply think it would be unwise for any module to change .htacces

If anyone could think of a better solution, let us know!

#4

yrocq - November 22, 2009 - 23:46

I wonder if we should continue to use path aliases to support Wordpress permalinks. A better solution may be to store in a table for each imported post the Wordpress post name, the Wordpress post id and the created node id. This table could be used by a wordpress_import_legacy module that looks for a Wordpress permalink in the path or the query string of the current url and load the matching node if it finds one.

#5

lavamind - November 26, 2009 - 04:35

In my view, we should avoid duplicating functionality of Drupal core. What would the benefit be from creating a module like this, exactly?

The case we are looking at here is specifically where the imported Wordpress has "ugly" permalinks (other permalink styles work fine) AND wants to keep the same URLs. Since this case is likely to be the exception rather than the rule, I don't we should go out of our way to create a very specific solution that would also be extra work to maintain...

 
 

Drupal is a registered trademark of Dries Buytaert.