Fix endless digest loops occurring in IE due to location rewrites

https://www.openproject.org/work_packages/11911
https://www.openproject.org/work_packages/11641