Forum Discussion
Ashu_2116
Nimbostratus
Jul 05, 2017http redirect i-rule under https VS not working
Hi I am new to i-rule writing. I have 4 urls hosted on one web server. And web server is front ended by Big IP LTM for ssl offloading. Now i want my urls to redirect to /directory when accessing it w...
nag_54823
Cirrostratus
Jul 06, 2017Please try below
when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "abc.bbc.com" and [string tolower [HTTP::uri]] equals "/"} { HTTP::redirect https://abc.bbc.com/mydirectory/ } }
Stanislas_Piro2
Cumulonimbus
Jul 06, 2017NAG zzz
I think this code will help Ashu, but there is no need to convert uri to lowercase to compare it with / . lowercase and uppercase of / is still / 🙂
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "abc.bbc.com" and [HTTP::uri] equals "/"} {
HTTP::redirect /mydirectory/
}
}
@Ashu, don't use the same irule on both virtual servers.
- on HTTP VS, use the default sys_https_redirect
- on HTTPS VS use this irule
You will have 2 redirect if user requests http://abc.bbc.com/ but transparent for user.
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