This bug was discovered here: https://github.com/simplesamlphp/simplesamlphp/issues/611 Basically, I believe our code is making relative links relative to the hostname instead of the hostname + directory of the current URL.