Forum Discussion
DM_5174
Nimbostratus
Jun 20, 2007Need urgent Redirect help!!!!
Hi all -
I have a problem here with redirecting the URL.
1. when users come in with http, the rule below needs to do a https redirect. This is working so far, however, when I try to add the following URL it is not redirecting to another pool.
This is working:
http://www.mysite.com -> https://www.mysite.com
This is not working:
http://www.mysite.com/site1 -> should get redirected to Pool "www_apache"...
I would like to add the "site1" redirection also to the same irule for the
https redirection below, but can not figure out how to do so. Please help!
Thanks!
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
- Colin_Walker_12Historic F5 AccountIf all you're trying to do is modify the above rule so that all mysite.com/site1 requests go directly to the www_apache pool, you'd want something like this:
when HTTP_REQUEST { if { ([HTTP::host] ends_with "mysite.com") and ( [HTTP::uri] starts_with "/site1") } { pool www_apache } else { HTTP::redirect https://[HTTP::host][HTTP::uri] } }
- DM_5174
Nimbostratus
Hi Colin, - DM_5174
Nimbostratus
Oh for got also, I i want the following - Colin_Walker_12Historic F5 AccountWell now you're talking about two separate iRules, on two separate Virtual Servers.
when HTTP_REQUEST { HTTP::redirect https://[HTTP::host][HTTP::uri] }
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/site1*" - "/site2*" - "/site3*" - "/site4*" { pool www_apache } } }
- DM_5174
Nimbostratus
Hi Collin -
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