Forum Discussion
HTTPS >>> HTTP Redirect
We have a redirection configured for the URL http://stp.xxx.com.sa as below which is working fine.
when HTTP_REQUEST {
if { [HTTP::host] eq "stp.XXX.com.sa" } { pool ST_Proxy_9080_Pool }
}
Now we need to redirect all the HTTPS pages of this URL to HTTP page below are some pages.
https://stp.xxx.com.sa/stwebclient/index.jsp >>> http://stp.xxx.com.sa/stwebclient/index.jsp
https://stp.xxx.com.sa/stbaseapi/baseComps.js?lang=ar >>> http://stp.xxx.com.sa/stbaseapi/baseComps.js?lang=ar
Could someone advise on how to do this redirection.
- Chris_PhillipsNimbostratusIs there a reason you aren't using httpclass profiels to do this? That's *exactly* the kind of thing they are for:
- Pandiarajan_701NimbostratusThanks...
- nitassEmployeein case you would like to try irule. additionally, you may put url into data group and use class match command in irule instead of hard-coding url in the irule as following.
[root@ve1024:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.19.79:443 ip protocol 6 rules myrule profiles { clientssl { clientside } http {} tcp {} } } [root@ve1024:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { switch [HTTP::uri] { "/stwebclient/index.jsp" - "/stbaseapi/baseComps.js?lang=ar" { HTTP::redirect http://[HTTP::host][HTTP::uri] } } } } [root@ve1024:Active] config curl -Ik https://172.28.19.79/stwebclient/index.jsp -H "Host:stp.xxx.com.sa" HTTP/1.0 302 Found Location: http://stp.xxx.com.sa/stwebclient/index.jsp Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@ve1024:Active] config curl -Ik https://172.28.19.79/stbaseapi/baseComps.js?lang=ar -H "Host:stp.xxx.com.sa" HTTP/1.0 302 Found Location: http://stp.xxx.com.sa/stbaseapi/baseComps.js?lang=ar Server: BigIP Connection: Keep-Alive Content-Length: 0
Recent Discussions
Related Content
* 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