Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here are my steps:
- Download and install module, enable it in Admin > Modules
- In admin/build/path-redirect/edit, enter existing URL alias on site in the FROM field
- Enter different existing URL alias on site in TO field, and click SAVE
- In admin/build/path-redirect, verified that URL aliases were entered correctly by clicking them
- Enter FROM URL in browser address bar, click GO
- RESULT: browser went to FROM URL
- Expected result: browser is redirected to the TO URL
I'm using Drupal 6.11. This seems to be a pretty straightforward module, therefore my conclusion is that it's not working. I'd be happy to hear otherwise.
Dale
Comments
Comment #1
MiMe CreditAttribution: MiMe commentedI'm having the exact same problem with my installation! It doesn't do anything.
Comment #2
MiMe CreditAttribution: MiMe commentedThis is Not fixed in the 6.x-1.x-dev version either.
Comment #3
MiMe CreditAttribution: MiMe commentedChanging priority to critical since the module does not work!
Btw, I'm using Drupal 6.12
Comment #4
Dave ReidOk I take a look at it. Do both of you have clean URLs enabled/disabled? Do you have language prefixing enabled? Anything to help me debug this?
Comment #5
jjeff CreditAttribution: jjeff commentedI noticed that that D6 version is using hook_init() rather than hook_boot(). My understanding is that hook_init() doesn't fire for cached pages. This would cause this type of "nothing is happening" behavior for non-logged-in users on sites with page caching turned on.
Comment #6
MiMe CreditAttribution: MiMe commentedYes, I have clean URLs enabled. I also have Locale installed but I'm not using any prefixes. I have tried clearing the cache and logging out, but this does not help.
Comment #7
Dave ReidUsing hook_init() should work just fine since Drupal doesn't cache 404 pages. Therefore the code should execute everytime the path is requested.
Comment #8
jjeff CreditAttribution: jjeff commentedInteresting, but what if you're redirecting an existing path to something better.. For instance redirecting "/node" to "/my-better-views-listing"...
But perhaps I'm getting off-topic for this thread.
Comment #9
Dave ReidOh, path redirect shouldn't be used for existing paths. I think the from field is actually validated so that you can't use existing paths. In that case path alises and global redirect should be used.
Comment #10
MiMe CreditAttribution: MiMe commentedSay what?
What you're saying is that path redirect will never work with any existing paths? This is the whole concept of a redirect.
Comment #11
dalehgeist CreditAttribution: dalehgeist commentedI'm just as surprised as MiMe.
I think I was clear in my initial post that I was attempting a redirect from an existing path. The from field quite happily allows me to enter existing paths - validation against existing paths would be a good idea, but doesn't seem to be happening currently. I changed this bug to a feature request to reflect this.
I just deleted the existing path from the Drupal database (Admin > Site Building > URL Aliases), and indeed, the redirect now works as expected.
Comment #12
MiMe CreditAttribution: MiMe commentedHmm... I cannot get this to work even though I have deleted the existing path.
Lets say that I already have a valid URL alias (since I have saved my node and this creates an alias).
The node is now accessible from both the http://www.example.com/alias and http://www.example.com/node/x which is not good.
Lets enable the path redirect module to fix this... (as I have done on all of my previous websites)
I enable the path redirect module and goto the settings in URL alias, check the "Create a new alias. Redirect from old alias".
Re-save the http://www.example.com/node/x, which re-save the alias and automatically create a 301 redirect from http://www.example.com/node/x to http://www.example.com/alias... but no 301 is being done, both URLs are accessible as if path redirect is doing nothing.
When I go to the URL redirects list I would expect to see a redirect from http://www.example.com/node/x to the http://www.example.com/alias by a 301 permanently moved. But nothing happen... both URLs work.
Well, lets add a redirect directly since it should work to redirect a core node path to an alias created with pathauto, right?
From: node/x
To: alias
Language: All languages
The redirect is listed but does not work. If I instead enter as the To the redirect works, well actually not correct since in this case redirects to the path entered as the standard front page http://www.example.com/frontpage, and not the http://www.example.com as would be expected.
So my guess is that something is still wrong with the module.
Comment #13
apadernoWhat the maintainer said is that already a module that works with existing paths; if this module would do the same thing, then it would be a duplicate, in term of functionality, of the other module.
Comment #14
dalehgeist CreditAttribution: dalehgeist commentedI originated this bug, and I'm closing it: the behavior of the module is by design. If you redirect from a non-existent path, the module works fine.