Forum Discussion
smoraneng
Jun 03, 2019Nimbostratus
Redirect based on # of domain parts
I have a server that has several websites on it. I need to create a redirect for the sites, but it needs to be rather generic because the developers don't always tell us what the sites are. I want ...
- Jun 03, 2019
Try this
when HTTP_REQUEST { if { !(string tolower [HTTP::host] starts_with "www") && (llength [split [HTTP::host] "."] == 2) } { HTTP::redirect "http://www.[HTTP::host][HTTP::uri]" } ]
KR,
Dario.
Jun 03, 2019
Try this
when HTTP_REQUEST {
if { !(string tolower [HTTP::host] starts_with "www") && (llength [split [HTTP::host] "."] == 2) } {
HTTP::redirect "http://www.[HTTP::host][HTTP::uri]"
}
]
KR,
Dario.
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