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.
When deslash is enabled and Apache mod_dir is enabled, visiting a url which resolves to a directory will result in an redirect loop.
What are the steps required to reproduce the bug?
Install latest global redirect module with deslashing enabled, on an Apache server using mod_dir (enabled by default on most systems).
Visit any directory, e.g. http://example.com/sites/default/files/
What behavior were you expecting?
The directory page would be loaded and a 403/404 error would occur.
What happened instead?
An infinite loop occurred which eventually timed out.
Comment | File | Size | Author |
---|---|---|---|
#1 | globalredirect-check-directory-before-deslash-2013785-1.patch | 1.23 KB | markpavlitski |
Comments
Comment #1
markpavlitski CreditAttribution: markpavlitski commentedThis patch adds a check to confirm if the path is a directory before deslashing.
If it is a directory, the redirect does not take place.
Comment #2
jakob123 CreditAttribution: jakob123 commentedFixes the issue. Even if it didn't cause a redirect loop, deslashing a directory is just wrong - the patch fixes that.
Comment #3
dbazuin CreditAttribution: dbazuin at LimoenGroen commentedI can confirm the patch solves this issue.
Comment #4
seanBI was looking for this one. Nice fix!
Even tough sites/default/files should not be visited, showing a 403/404 is better then a redirect loop :)
Confirming RTBC!
Comment #5
rclemings CreditAttribution: rclemings as a volunteer commentedWorked perfectly for me.
It's been RTBC for four years now. Why isn't it committed?
Comment #7
BarisW CreditAttribution: BarisW as a volunteer commentedThanks all for the work!