Forum Discussion
Pete_Paiva_7147
Nimbostratus
Aug 28, 2007https to http redirect
I'm looking to create an iRule that will take https://my.mycompany.com and redirect it to http://my.mycompany.com.
So in other words, if someone were to put in https:// it would redirect them to http:// -- the URL would stay exactly the same.
Any help would be greatly appreciated.
Thanks,
-Pete
3 Replies
- Pete_Paiva_7147
Nimbostratus
Hamish,
Thanks for the response. That one I already have working in our environment. I tried playing around with the syntax but I can't get it correctly.
Any further help would be greatly appreciated. - Wil_Schultz_101
Nimbostratus
I have a similar setup in one of my rules, this is a permanent redirect (301):when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "my.mycompany.com" { HTTP::respond 301 \ "Location" "http://my.mycompany.com[HTTP::uri]" \ return 0 } } }
Or if you're looking for a temp redirect (302):when HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "my.mycompany.com" { HTTP::redirect "http://my.mycompany.com[HTTP::uri]" return 0 } } } - Pete_Paiva_7147
Nimbostratus
I think I'm doing something wrong -- neither of the 2 iRules seem to be working correctly. I replaced the "my.mycompany.com" with the actual URL but still not having any luck. The https url doesn't seem to be redirecting to http.
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