Good point, I'll need to modify the redirect to disallow multiple slashes at the beginning.
That should be something like /\A(http(s?):\/\/#{request.host_with_port}|\/\Z|\/[^\/])/
That should be something like /\A(http(s?):\/\/#{request.host_with_port}|\/\Z|\/[^\/])/