Forum Discussion
mikey_webb
Cirrus
Nov 25, 2014irules redirect help required
i have the below irule which will redirect to SSL, the question is how can i change so that http://www.mysite.co.uk/ does not get redirected but remains as http - thanks
when HTTP_REQUEST { ...
nitass
Employee
Nov 25, 2014this is just another example.
configuration
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"www.mysite.co.uk" { return }
"www.*" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
default { HTTP::redirect "[HTTP::host][HTTP::uri]" }
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I /">http://172.28.24.10///">/">http://172.28.24.10/// -H "Host: www.mysite.co.uk"
HTTP/1.1 200 OK
Date: Tue, 25 Nov 2014 13:38:18 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
ETag: "41879c-59-2a9c23c0"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8
[root@ve11a:Active:In Sync] config curl -I /">http://172.28.24.10///">/">http://172.28.24.10/// -H "Host: mysite.co.uk"
HTTP/1.0 302 Found
Location: mysite.co.uk/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I /">http://172.28.24.10///">/">http://172.28.24.10/// -H "Host: yoursite.co.uk"
HTTP/1.0 302 Found
Location: yoursite.co.uk/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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