Closed (fixed)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Dec 2006 at 16:34 UTC
Updated:
6 Nov 2012 at 17:44 UTC
Jump to comment: Most recent file
The Path Redirect module is a great module to help with the duplicate content problem.
I've been thinking for a while that Pathauto should provide a further "Update action:" to users:
Create a new alias, make the old one a redirect
This would do basically as it says - rather than just replacing the old one it would take the old one and make it a redirect. There is a problem of what kind of redirect to make it (302, 301, etc.). My preference is 301 but it should be user configurable - probably within the Path Redirect module as a default for new ones that Pathauto would then respect.
If the Path Redirect module is not installed this option would be greyed out.
Thoughts?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | pathauto_path_redirect.patch | 3.63 KB | greggles |
| #6 | pathauto-redirect.patch | 3.07 KB | jjeff |
Comments
Comment #1
TheWhippinpost commentedHeh, I only read as far as the first line and immediately thought, "Yes!".
I agree WRT: 301 preference since the old duplicate URL is effectively dead - However, I guess the additional options might prove useful for some users and their various scenario's... could always be removed at a later date if it's existence is felt to be redundant.
(My perfection-fetish-side-of-me though say's the dupes should be deleted to save DB space and user-confusion ;) )
+1
Comment #2
mcurry commentedWhile I like (and want) this feature, it seems odd (to me) to put it in pathauto - after all, if I never use pathauto, this feature would not help me - what about those who don't use pathauto?
If path_redirect is installed, it would be way cooler to have that module detect the path alias changes (on node edits) and do the right thing. Then, no need to modify pathauto. Not sure how this would be done, though.
Comment #3
gregglesProbably the best way to find out if this could be implemented in path redirect is to use the issue queue for that module instead of this one.
Did you create such an issue?
I don't think it's possible, but I won't be implementing this feature for a while so maybe it is...
Comment #4
mcurry commentedNo, I've not yet created a suggestion in path_redirect - I will do so ASAP. Thanks for all the feedback.
Comment #5
OpenChimp commentedI not aware of what triggers are available to set off this action, but ideally this action could be triggered any time the path for a node is updated.
When a node path is updated:
It would also be great to have a global setting somewhere that would allow this to be done automatically any time a node path is updated, but having this manual interface provides the flexibility needed by some users.
Comment #6
jjeff commentedHere's a patch that is tested and working with Path Redirect 1.1-beta1.
If Path Redirect module is enabled, another option appears -- "Create a new alias. Redirect from old alias." If this option is chosen, old pathauto paths will get saved as redirect paths that redirect to the new alias for the node.
This essentially means that all old aliases for a node become redirects to the current alias. It's pretty slick! :-)
Please test and post successes/problems. Thanks.
Comment #7
gregglesExcellent stuff!
So, this was calling the path_redirect_save($save) even if there was no old alias - i.e. even if it was the initial creation of a node. This had the effect of creating a single entry in the path redirect system that pointed at the most recently saved node.
The attached patch attempts to fix that by adding an if to check for the old alias. Thoughts? I think it's ready to commit.
Comment #8
jjeff commentedEek! Good fix.
I'm down if you're down.
Commit away!
Comment #9
gregglesVery nice. Applied to the 5.x-2 branch.
Comment #10
greggles*cough*
Comment #11
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #12
OpenChimp commentedA big thanks! MikeyLikesIt
This will help with SEO a lot.
Comment #13
summit commentedHi, opening this issue again for the D6 branch.
Would it be possible to also commit this functionality to the D6 branch?
Thanks a lot in advance for considering!
Greetings, Martijn
Comment #14
gregglesThis was applied to 5.x-2.x before we branched for 6.x so it is included in 6.x.
Comment #15
summit commentedGreat thanks for the update, greetings, Martijn
Comment #16
sirkitree commentedI'm not seeing this in the 7.x - reopening?
Comment #17
dave reidThe option is in the Redirect module settings for creating redirects when URL aliases change. This option is not in Pathauto anymore.