-
Feature Request
-
Resolution: Done
-
Minor
-
1.2.0.Beta10
-
None
I need a rewrite rule like this :
regex[pattern='/'] -> redirect['/homepage.html']
But RFC-2616 says that the "Location" header should be an absolute URL.
So I need a way to convert "/homepage.html" to an absolute URL.
One way to do this is :
redirect['%{SCHEME}://%{i,Host}/homepage.html']
but it will not work for HTTP 1.0 requests (without a host header).
A better way would be to use HttpServerExchange.getHostAndPort(), maybe through a new ExchangeAttribute type. For example :
redirect['%{SCHEME}://%{HOST_AND_PORT}/homepage.html']