Forum Discussion
WillC_97839
Nimbostratus
Dec 14, 2009Redirect irule puts in query twice
Hi there,
I've got a basic irule so when someone hits my admin vhost, it will always go over https. The current rule is:
when HTTP_REQUEST {
set myURI [string tol...
hoolio
Cirrostratus
Dec 14, 2009Are you just wanting to redirect with the full URI preserved? In F5 terms, the host is the host header value, the URI is everything after the host which includes the path and the query string. The query string is everything in the URI after the question mark:
http://www.example.com:80/path/to/file.ext?param1=value1¶m2=value2
HTTP::host - www.example.com:80
HTTP::uri - /path/to/file.ext?param1=value1¶m2=value2
HTTP::path - /path/to/file.ext
HTTP::query - param1=value1¶m2=value2
I'd guess this would work for you:
when HTTP_REQUEST {
Check if host, set to lower case, is admin.mysite.com
if { [string tolower [HTTP::host]] eq "admin.mysite.com"} {
Redirect client to same host and URI via https
HTTP::redirect "https://admin.mysite.com[HTTP::uri]"
}
}
Aaron
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