I've read the manual and searched extensively on this, but I seem to be
missing something. How can I substitute just the requested *hostname*
(excluding a non-standard port) in a redirect? I tried:

http-request redirect prefix http://%[hdr(host)].example.com code 301


However, this preserves the non-standard port number if specified in the
request, resulting in something like:

Request:
GET / HTTP/1.1
Host: original-hostname.com:81

Response:
HTTP/1.1 301 Moved Permanently
Location: http://original-hostname.com:81.example.com/

I'll have a fairly sizeable and dynamic lists of hosts, so adding explicit
per-host ACLs/redirects is not desired.

Is there any way to strip the requested port from the host header? Is there
any other way to substitute just the requested hostname?

Thanks!
--Scott

Reply via email to