I checked a server's configuration file and saw 'redirect-carefully' setting.

Checking the docs:




This does not say much on how exactly the server behaves differently when redirect-carefully is set.

What exactly does it mean to "be more careful when sending a redirect"?

1 Answer 1


... a problem handling redirects on directory resources via DAV methods.

This would seem to be the key point here. Normally, mod_dir (with the help of the DirectorySlash directive - which is On by default), will append a trailing slash on all slashless directory requests with a 301 redirect. ie. example.com/subdir gets 301 redirected to example.com/subdir/. This would seem to be regardless of what method is used in the request: GET, POST, including the WebDAV methods COPY, LOCL, MKCOL, etc.

Setting the redirect-carefully environment variable would seem to prevent this redirect from occurring on these WebDAV methods, which can otherwise cause problems. Or more specifically, the redirect only occurs on GET requests. (Note that this excludes POST requests - but POST data is lost during a 301 redirect anyway, and besides, you probably shouldn't be sending POST requests to a "directory" anyway.)

This is the only resource I found that backs this up:

Setting the environment variable "redirect-carefully" fixes some issues with various Web Folder applications that do not handle Redirect requests correctly. Normally mod_dir would respond to all requests for the URL http://servername/dav with a redirect request to http://servername/dav/. With "redirect-carefully" set this will now only happen for GET requests.


Your Answer

