At http://driverpacks.net, virtually all watchdog entries are generated by path_redirect. That's not very useful. At least not for me. (The reason for that insane amount of redirects is that there's >5 years of historical linking from other sites to that site, thus the relative redirect usage is very high.)
It's only a couple of lines of code and a very sensible, small feature — IMHO at least.
Let me know what you think :)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 973700-4.patch | 1000 bytes | wim leers |
Comments
Comment #1
dave reidThe module should only be generating entries when it needs to (cases of infinite loops, etc). Could you at least provide more information about what watchdog messages you're seeing?
Comment #2
wim leersNow that you mention it, they're indeed all for infinite redirect loops!
In my case, I'm redirecting from the old-style URL http://driverpacks.net/DriverPacks to http://driverpacks.net/driverpacks. It seems Path Redirect considers the "from" path in a case insensitive manner, which then causes this problem.
I'm not sure I'm in a position to suggest how to deal with this — I think I'll just await your point of view on this :)
Comment #3
dave reidThat's because Drupal treats both mixed and lower case the same. The best solution is to add a lower-case condition to your htaccess file.
Comment #4
wim leersAha!
After all those years in Drupal, I had no idea about that.
But *where* does this happen then? I see this in the code:
Now, if I try the following:
Then Drupal doesn't treat them as the same. I believed you when you claimed it was Drupal to blame, but it turns out it's not! :) (This is what I get for writing the issue follow-up while working things out.)
Rather, it seems it does a redirect once (from "/DriverPacks" to "/driverpacks") and then it checks if it is still equal. But I had missed something: why was it checking for a redirect anyway? It's your query in
path_redirect_load_by_source()that should prevent case-insensitive matches!Patch attached. You may want to make this an option though. This supersedes #617366: Add an option for case-insensitive redirects and makes that one into a duplicate.
Comment #5
wim leersI didn't see #617366: Add an option for case-insensitive redirects's patch before. It's a more comprehensive solution and might therefore be better. I'll leave it up to you, the module maintainer, to decide what to do, hence not yet marking this as duplicate, but feel free to do so.
Comment #6
dave reidThis type of redirect is probably better suited for Global redirect, not Path redirect. I've added code to prevent people from creating this type of redirect now.