Forum Discussion
https matching
Hi,
I have an issue where we are re-directing http > https and adding some extra lines to a URI on the port re-direct.
When we target the Virtual server directly on HTTPS the re-direct is missed, and we just see the Admin page.. so ther serverside is not capible of the re-direct without the extended URI.
I need a solution in the HTTPS virtual server to match the Hostnames and ensure that they have the extra URI string to hit the web server directly.
so https://mysite.com/something/something
thanks
19 Replies
- nitass
Employee
i think you do not need /something/something/* pattern because it will match default pattern anyway.
when HTTP_REQUEST { switch -- [string tolower [HTTP::uri]] { "/" { HTTP::redirect "https://[getfield [HTTP::host] ":" 1]/something/something" return } default { pool mysite-pool } } } Just a quick one.
if I use this, when I come in with something/something already in the URI I presume it wont match and ignore the Irule
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/something" } }
- nitass
Employee
yes, it doesn't match if expression (because uri is not equal to /) and, of course, body (HTTP::redirect) won't be executed.
I put this irule into the https virtual server but it has no impact whatsoever..
- nitass
Employee
can you do some debugging? https://devcentral.f5.com/s/articles/getting-started-with-irules-logging-comments-20406
- Max_Q_factor
Cirrocumulus
I would use this as an irule for a https server:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals "/" } { HTTP::redirect https://[getfield [HTTP::host] ":" 1]/something/something } ok so its working for some browers not for Mozilla ??
really dont know why.. its very strange.. any ideas why Firefox would ignore the rule..??
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/something/something" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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