Forum Discussion
Patrick_Berthia
Nimbostratus
Feb 10, 2006HTTPS redirect
Hi,
Im trying to make this work but not getting the expected results.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect https://[HTTP::host][HTTP::uri "/some_java_app"]
}
}
I just want to force the users that are using the http://mysite.domain.com to redirect them to https://mysite.domain.com/some_java_app
Any tips would be greatly appreciated
3 Replies
- What results are you getting? Odds are the HTTP::uri command you have embedded is not returning the updated value that you are assigning it within the command. This would cause an infinite loop if you have the same iRule on the 80 and 443 virtuals.
Personally, I'd do something like this:when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/some_java_app" } }
You don't need to reassign the HTTP::uri value if you are doing a redirect.
-Joe - Patrick_Berthia
Nimbostratus
Hi,
Tried using the rule you supplied, this is what happens:
I hit https://mysite.domain.com/ and am redirected to https://mysite.domain.com/some_java_app although when using http://mysite.domain.com/ I'm not getting redirected to https://mysite.domain.com/some_java_app as expected.
Any clue on what im doing wrong? - JRahm
Admin
How are your virtual servers configured? Are you using a wildcard virtual server (10.10.10.10:0) or virtual servers for each service (10.10.10.10:80 and 10.10.10.10:443)?
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