Closed (fixed)
Project:
Wordpress Import
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2009 at 18:03 UTC
Updated:
23 Dec 2009 at 05:00 UTC
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...
Comments
Comment #1
lavamind commentedMore info : http://www.webopius.com/content/149/migrate-data-from-wordpress-to-drupal-6
Comment #2
milehighlife commentedHas anyone successfully used Wordpress Import to alias the ugly permalinks?
Comment #3
lavamind commentedThis 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 likep/[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 .htaccesIf anyone could think of a better solution, let us know!
Comment #4
yrocq commentedI 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.
Comment #5
lavamind commentedIn 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...
Comment #6
yrocq commentedUsing this method would also allow to easily emulate other Wordpress urls like tag/mytag without filling the path alias table. It also offers the advantage of managing clean and ugly url at the same place.
However, I agree that it can represent to much work for a not so useful feature. I think the .htaccess can be a good alternative as long as we just provide a documentation for it and don't try to implement it in the module.
Comment #7
milehighlife commentedlavamind,
If I understand you correctly, I would need to create a Drupal-friendly alias (p/[id]) for every ugly URL (?p=[id]) being imported. Then, use .htaccess to rewrite ugly URLs to the alias. I have three different data sets to import into a single Drupal install -- /blog/?p=[id], article.php?id=[id], places.php?placeID=[id] -- and I'm assuming I'd need to create an alias and rewrite rule for each data set?
Thanks.
Comment #8
lavamind commentedmilehighlife,
Precisely, the creation of the alias would be handled by Wordpress, while the required .htaccess snippet would be documented in the README. That said, the other two link types you mentioned,
article.php?id=[id]andplaces.php?placeID=[id]don't seem like ordinary Wordpress ugly-style permalinks. Are they used by 3rd-party plugins?Comment #9
lavamind commentedFix committed in 6.x-2.x-dev.
See new README information for details on how to adjust your
.htaccessfile.Anyone care to test this ?
For the record, this page helped me figure our the required Rewrite instructions : http://fantomaster.com/faarticles/rewritingurls.txt