Forum Discussion
Marker_58065
Nimbostratus
Dec 15, 2010Append domain when needed and redirect to HTTPS
Here is the background - we have a couple of internal F5s with a bunch of applications that we are doing SSL offloading on. When users access these applications they don't have to type the FQDN becau...
Marker_58065
Nimbostratus
Dec 22, 2010Sorry about the confusion...this one is totally different. Now I am just taking about a standard url redirect, like a user puts in 'site1' and gets sent to 'http://sharepoint.domain.net/somesite/etc/'. I got about 300 of them all on 1 virtual. I have the same problem with not always getting the full domain in the host request. Today I have this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
site1* {
HTTP::redirect https://sharepoint.domain.net/sites/default.aspx
}
helpdesk* {
HTTP::redirect http://remedy.domain.net/login
}
dashboard* {
HTTP::redirect https://dashboards.domain.net/corda/dashboards/
}
}
}
It is a really long irule, but it works. Seems like a datagroup would be easier to maintain than this. I came up with this, but I am wondering if there would be a better way.
class URL-REDIRECTS {
{
site1 { "https://sharepoint.domain.net/sites/default.aspx" }
helpdesk { "http://remedy.domain.net/login" }
dashboard { "https://dashboards.domain.net/corda/dashboards/" }
}
}
when HTTP_REQUEST {
Remove domain and look up the requested host in the datagroup
set Host [class search -value URL-REDIRECTS eq [string map -nocase {".domain.net" ""} [HTTP::host]]]
log local0. "Host var is $Host"
if { $Host ne "" } {
HTTP::redirect $Host
}
}
Maybe I should have started a new thread on this one.....Anyway, I hope that clears up what I am trying to do. Thanks!
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