Forum Discussion
viper_113332
Nimbostratus
Aug 30, 2010http to https redirect default switch back.........
Hi All,
am using the below irule to redirect specific "http" sites to "https", i need to add a switch that will help me direct back to HTTP as well, this could be a default switch. can a...
viper_113332
Nimbostratus
Sep 01, 2010
Hello Naladar,
redirection from http to https is done only for the specified path. but acctually i need to extend my irule to use TCP port 80 for all other requested paths. this is because i need the website to be HTTP by default except couple of paths which include a login that should be encrypted.
example:
when HTTP_REQUEST {
log local0. "path [HTTP::path]"
log local0. "uri [HTTP::uri]"
use -regexp options
switch -regexp [string tolower [HTTP::path]] {
"/test1.*"
{log local0. "HTTP_REQUEST switch match"
HTTP::redirect "https://www.site.com/ar/services/test1.asp"}
"/test2.*"
{log local0. "HTTP_REQUEST switch match"
HTTP::redirect "https://www.site.com/ar/services/test2.asp"}
default
{
if any other request is initiated then the client TCP port will switch back to port 80. thus the users browser will direct back 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