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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markpavlitski’s picture

Status: Active » Needs review
FileSize
1.23 KB

This 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.

jakob123’s picture

Status: Needs review » Reviewed & tested by the community

Fixes the issue. Even if it didn't cause a redirect loop, deslashing a directory is just wrong - the patch fixes that.

dbazuin’s picture

Issue summary: View changes

I can confirm the patch solves this issue.

seanB’s picture

I 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!

rclemings’s picture

Worked perfectly for me.

It's been RTBC for four years now. Why isn't it committed?

  • BarisW committed ef5cbb3 on 7.x-1.x authored by markpavlitski
    Issue #2013785 by markpavlitski, jakob123, dbazuin, seanB, rclemings:...
BarisW’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all for the work!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.