Forum Discussion
John_Glass_3854
Sep 13, 2006Historic F5 Account
Modification of http response header when using HTTP::redirect
Hello,
I think I'm trying to do something very basic - redirect all HTTP traffic for a given virtual address to the HTTPS virtual server. I found SOL3847 at Ask F5, which appeared to be exa...
Sep 13, 2006
I don't believe you can override the header values in the HTTP::redirect command. But, you can always use the HTTP::respond command to send back any respond code you wish. And, that command allows you to add headers.
HTTP::respond [content ] [ ]+
when HTTP_REQUEST {
HTTP::respond 302 Location "http://www.domain.org" "Server" "Company Name"
}
The downside to this is that it will return two Server headers, one with "Company Name" and another with the default "BIG-IP". Looks like that one is hard coded in there.
The reason a "HTTP::header replace" won't work is that that is in the context of a request. The HTTP::redirect and respond generate new response messages with their own set of headers. I'm not sure if a stream profile will work on headers in BIG-IP generated responses, but it's worth a try.
If you want to change the response code to a 301, go ahead and change it in the respond command.
*Update* - should have checked to see that deb already responded...
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects