*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

Dave Reid’s picture

You'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.

Dave Reid’s picture

Status: Active » Fixed
Adam Wood’s picture

Hi 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

Dave Reid’s picture

You 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?

Adam Wood’s picture

To 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.

Adam Wood’s picture

Seems 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tuccio’s picture

Dave 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.

tuccio’s picture

Issue summary: View changes

Possibly not a bug, just lack of functionality.

rickdonohoe’s picture

Issue summary: View changes

I'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?

rickdonohoe’s picture

Version: 7.x-1.1 » 7.x-1.2
Status: Closed (fixed) » Active
jcalais’s picture

We 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.

Steve Polito Design’s picture

Shameless plug, but this can be achieved using Views Bulk Operations. I wrote a blog post about it.

vulfox’s picture

I did exactly as suggested in the blog post. Redirects are just not created even when using VBO to update aliases.

TravisJohnston’s picture

Same as vulfox,

I have the "Auto create redirect when URL Alias changes" set in the Redirect/Settings page as well

I attempted:

  1. #24's post about using VBO. Only the URL gets updated, no redirects created.
  2. finding the nodes under admin/content and using the core "Update Alias" feature there, same as above happens.

Maybe using Feed Importer or something is the way to address this?

psegarel’s picture

I 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.

squarecandy’s picture

#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!