Forum Discussion
Pav_70755
Nimbostratus
Oct 27, 2008https re-directs
Hi,
I am trying to re-direct two https secure sites, currently there is an i-rule in place to re-direct the standard sites:
elseif { [HTTP::host] == "www.url.com" } {
HTTP::redirect "http://www.welcome.com"
I want to have the same re-direct for the secure site so:
https://www.url.com to re-direct to www.welcome.com
SSL is enabled in the i-rule any help would be much appreciated.
Thanks
Pav
3 Replies
- James_Quinby_46Historic F5 AccountPav -
Since the https site would be on its own Virtual Server, the iRule that would accomplish this would be largely the same as the one you've listed above. There is more information at:
http://devcentral.f5.com/wiki/default.aspx/iRules/HTTPToHTTPSRedirect_301.html
...but it could be accomplished with something like:when HTTP_REQUEST { if { [TCP::local_port] == 80 }{ HTTP::respond 301 Location "https://www.newurl.com" } } - Pav_70755
Nimbostratus
Thanks for the reply the re-directs are on the same virtual server so I basically want to re-direct:
https://www.url.com/welcome.asp and https://www.url.com/join.asp
to
http://www.url.com/joining_form
so how would I incorporate the rule you suggested to do this re-direct?
So its actually a https to http re-direct
Thanks
Pav - dennypayne
Employee
Hi Pav,
You're going to have to first do SSL decryption in order to be able to do this, you can't manipulate the HTTP request before it is decrypted (see this post (Click here) for more info).
Other than that, you would just need to do:when HTTP_REQUEST { if { [HTTP::uri] eq "welcome.asp" or [HTTP::uri] eq "join.asp" } { HTTP::redirect "http://www.url.com/joining_form" } }
This post (Click here) also has good info on doing this with matchclass if you need more than 2 or 3 URL's to match.
Denny
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
