Forum Discussion
spraycj_86914
Nimbostratus
14 years agoHTTP class profiles and redirect
Is there a way with HTTP class profiles to do this type of redirection, or do I need to use iRules?
I want requests coming for both http://www.host.something.com and http://host.something.com to redirect to https://host.something.com.
My current class profile just has a redirect that looks like this:
https://[HTTP::host][HTTP::uri]
The problem is if a request comes in for http://www.host.something.com, it redirects to https://www.host.something.com. The servers in the pool don't expect www, and the request fails.
I thought that maybe having the redirect set to https://host.something.com/[HTTP::uri] might work, but wasn't sure.
Thanks!
2 Replies
- hoolio
Cirrostratus
Stealing from another user's recent post:
http://www.tcl.tk/man/tcl8.4/TclCmd/string.htmM47
https://[string trimleft [HTTP::host] www.][HTTP::uri]
Aaron - spraycj_86914
Nimbostratus
Thanks!