*EDIT*
Is the Pathauto/Redirect integration supposed to support a bulk update of URL aliases? If not, please disregard the below.
It seems very unclear after trawling through the many confused issues about this... It should probably be clarified somewhere.
******
The create redirect on update functionality doesn't seem to be working for me.
I'm using;
Pathauto 7.x-1.1
Redirect 7.x-1.0-beta4
... and I've got the following settings in Pathauto;
Do nothing. Leave the old alias intact.
Create a new alias. Leave the existing alias functioning.
Create a new alias. Delete the old alias.
I've got 'Automatically create redirects when URL aliases are changed' selected in Redirect.
I'm trying to change the aliases on 12,000 nodes, and was expecting to be able to do this using bulk update or deleting them and then re-creating them. However, when I do either of these, it doesn't create the redirect. By the looks of things, I'm missing this "Create a new alias. Redirect from old alias" option in Pathauto - or has that just been replaced with the settings in Redirect?
If I manually edit an existing alias, it creates a redirect to the old path, so something's working...
Any help would be appreciated.
Comments
Comment #1
Dave ReidYou'll want to use the option "Create a new alias. Delete the old alias."
Note that deleting and re-creating will never allow redirects to be created because you would destroy the possible paths to redirect from by doing the delete. Redirecting should work if you are bulk updating.
Comment #2
Dave ReidComment #3
Adam Wood CreditAttribution: Adam Wood commentedHi Dave,
Thats the setting that I have it on, however I can't bulk update if the paths are already aliased - I just get the message;
'No new URL aliases to generate'
Nor does it generate a redirect if I update the URL aliases through admin|content.
Is this related to; #1002854: Automatically create redirects when URL aliases are changed by PathAuto doesn't work
(I've updated to Pathauto 7.x-1.x-dev)
This seems to be very unclear on the Redirect issues; http://drupal.org/project/issues/redirect?text=pathauto&status=All
Comment #4
Dave ReidYou cannot bulk update from the Pathauto screen - you can only update items that have not yet been aliased. To bulk update, you would go to admin/content/node and use the 'Update URL alias' action (or this is also available if you use Views Bulk Operations). If updating via admin/content/node is not working, do you have the Pathauto Persist module enabled?
Comment #5
Adam Wood CreditAttribution: Adam Wood commentedTo clarify; the aliases update ok when I bulk update them via admin/content/node, however the redirects aren't created to the old alias. Using persist hasn't changed this.
The only way that redirects are created are if I manually update the alias.
Comment #6
Adam Wood CreditAttribution: Adam Wood commentedSeems like there's no answer for this, as seems to be the case with everyone who's asked. It need to be clear as to whether you can bulk update/redirect aliases with Pathauto/Redirect...
Anyways, for anyone else looking to do this; I ended up doing it in the DB. I exported (the existing) 'url_alisas' & (with a test redirect in to check structure) 'redirects' in CSV, then copied the aliases into the redirects (obviously obeying the different table structure) and then deleted the url aliases.
I then created my new pattern and bulk created the aliases. Job done... redirect finds the nid, nid finds the new path.
Comment #8
tuccio CreditAttribution: tuccio commentedDave Reid answered you at #4: you need to bulk update from the admin/content/node or perform a bulk operation. I have done a bulk alias update operation and got all my redirects created and working correctly.
Comment #8.0
tuccio CreditAttribution: tuccio commentedPossibly not a bug, just lack of functionality.
Comment #9
rickdonohoe CreditAttribution: rickdonohoe commentedI've been banging my head with this as well.
Scenario:
"I have changed the alias pattern for 2,000 nodes, and want to update these in a safe way".
Here I wouldn't bulk update as there would be no new nodes. Instead I have to delete all content aliases, then bulk update. This works however no redirects have been added, even though I am using the Redirect module setup as described above.
Can this be done so you can easily change a very large amount of nodes at once, whilst maintaining a redirect for the old alias?
Comment #10
rickdonohoe CreditAttribution: rickdonohoe commentedComment #11
jcalais CreditAttribution: jcalais commentedWe faced this same problem with taxonomy term pages a while ago and solved it by writing a drush script that only loads and saves all terms in a vocabulary. Appears to work just fine, because that generated new aliases for all terms in the vocabulary as well as made the old alias into a redirect.
Wrote a blog post about it for the place where I work, in case you want more details.
Comment #12
Steve Polito Design CreditAttribution: Steve Polito Design commentedShameless plug, but this can be achieved using Views Bulk Operations. I wrote a blog post about it.
Comment #13
vulfox CreditAttribution: vulfox commentedI did exactly as suggested in the blog post. Redirects are just not created even when using VBO to update aliases.
Comment #14
TravisJohnston CreditAttribution: TravisJohnston commentedSame as vulfox,
I have the "Auto create redirect when URL Alias changes" set in the Redirect/Settings page as well
I attempted:
Maybe using Feed Importer or something is the way to address this?
Comment #15
psegarel CreditAttribution: psegarel as a volunteer commentedI was able to solve this issue using Views Bulk Operations, as explained in the following blog article, mentioned in #12
http://www.stevepolitodesign.com/blog/bulk-update-redirects-after-changi...
...except that I didn't update the URL alias pattern before performing the update! After creating the View, I simply ran the bulk operation, which created URL redirects for the current alias pattern.
Then I updated the alias pattern & ran the bulk update operation, as expected URL aliases were updated, but no redirects were created.
Comment #16
squarecandy CreditAttribution: squarecandy commented#12 is really helpful/close, but didn't quite get me there. I had items that had custom aliases set and the "checkbox" off for pathauto automatic aliasing. Doing VBO "update aliases" didn't do anything to these nodes.
Here's what I ended up doing:
- find a way to get a list of all the nids you want to update.
- change the `pathauto` column in the `pathauto_state` table to 1 for each node you want to reset. I used the SQL screen on phpmyadmin, but you could do this a bunch of different ways:
UPDATE `pathauto_state` SET `pathauto`=1 WHERE `entity_id` in (123,124,125,126,127);
- Now go to your VBO admin screen that lists your nodes.
- Do the "Save Nodes" command on all of these nodes.
The result is the redirect module properly adds redirects from the old paths and the new paths based on the pattern are assigned to the nodes.
Cool!