Cannot create a redirect from a currently valid path?
hiades.mx - July 30, 2009 - 17:43
| Project: | Path redirect |
| Version: | 6.x-1.0-beta4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
Hi there
We are using Path redirect to redirect members of a site from og nodes (groups) to panel pages where we redesign the whole thing to simulate the group's home page with news, popular topics, members and all that stuff.
It worked for the first groups we created, but now I need another redirect for a newer group we just created and it just wont let me.
It just shows up the next warning: "You cannot create a redirect from a currently valid path."
I'm trying to create the next redirect:
node/19
to
groups/groupname/home
Do you have any ideas why is it doing this?
I'm using Path 6.x-1.0-beta4 and Drupal 6.13

#1
subscribing
#2
I am having the same trouble with a simple redirect..
from-> node/55
to-> node/36
Admittedly we don't use many redirects on our site but the few we set prior to updating to 6.x-1.0-beta4 work properly
#3
I had to remove a validation statment. Patch attached!
Jérémy
#4
patch tested and working for me. Thanks
#5
but where to put the patch?#6
subscribing
#7
patch tested and worked for me
#8
delete line 201, 202, 203 in path_redirect.admin.inc file or use "//" without quotes in front of line 201, 202, 203. This is the same thing that above patch has done.
#9
Thanks himagarwal for that post! I don't know how to do a patch, but it was very easy to uncomment those lines. And now the problem that was driving me crazy is solved :)
Cheers,
Jim
#10
The patch works great for creating redirects from system paths (as long as they don't have aliases). Are there any possible ill effects from the patch, or can this be applied?
#11
To the maintainers : it would be nice to allow to add redirect for valid system paths as well. Sometimes you have a global architecture that works well in the majority of cases, but you also have special cases in which you have to redirect some things.
Redirecting valid system paths can have desastrous consequences, like redirecting /user, so maybe this could be added as an admin setting of path_redirect ? Let me know what you think about it and I can then provide a patch.
Note : to redirect /node/X to /node/Y you can also use cck_redirection
#12
Another consequence is if a redirect is created for a path that does not yet exist on the site, but potentially will someday.
For example, if your site is brand new, and no nodes have been created, you can create redirects for node/1, node/4, node/N etc.
I believe the core path module also suffers from this phenomenon, but haven't checked the issue queue thoroughly. It appears to be a worse problem, as I don't believe it does a menu_get_item() check. You could imagine creating system paths like 'logout' as a node alias.
#13
Patch from #3 works fine.
#14
I'd much rather approve #615008: "Forced" path redirect - override the existing path or alias. I could loosen this up at least that you can't create redirects for paths that the current user doesn't have access to, like user/logout, etc. Let's work on a safer solution.
#15
replied on the new issue...
#16
Fair enough... but until then, patch updated to work with code in CVS
#17
I'm getting this error even when the path is NOT currently "valid". Use case: a view with taxonomy term arguments. A term changes, the old path with the old term needs to be 301 redirected to the new term. This version of url_redirect won't let that redirect in.
#18
Actually in that case it's still a valid path since it's handled by the view and wouldn't normally result in a direct 404 from Drupal's menu system, so this is still a duplicate. The issue linked would also solve this problem.
#19
Views is the most likely culprit - change the view display path temporarily, create redirects, then set the view display back to the original path.
Detailed post at http://peterpetrik.com/blog/2009/10/override-existing-path-with-path-red...