Forum Discussion
Chenco_322726
Nimbostratus
Jun 01, 2017HTTPS to HTTP when having another Irule for HTTP to HTTPS
Hello , im trying to redirect make a redirect on a specific page to work without the https. i've tried many of suggestions here/google and did not had luck yet . i do have another rule for that domain from http to https what im trying to do is to make another rule which will redirect the only specific page to http. can it be done? on which way?
Thank you.
- Jad_Tabbara__J1
Cirrostratus
Hello Chenco,
Add this irule to your HTTP VS
when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/page1/" } { do nothing only log to verify that it works properly log local0. "[HTTP::path]" } else { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } }
And add this irule to your HTTPs VS
when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/page1/" } { HTTP::redirect http://[getfield [HTTP::host] ":" 1][HTTP::uri] } else { do nothing only log to verify that it works properly log local0. "[HTTP::path]" } }
- Jad_Tabbara__J1
Cirrostratus
Hello Chenco,
You should modify your condition to
if { ([string tolower [HTTP::path]] starts_with "/page1/") && ([string tolower [HTTP::host]] equals "www.example.com") }
Regards
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