Forum Discussion

hortonw_37060's avatar
hortonw_37060
Icon for Nimbostratus rankNimbostratus
Feb 19, 2008

https and modifying URI question

This may be really obvious, but I can't seem to get this to work.

We have a web site for which the F5 is doing SSL. A user can browse to http://host.com or http://host.com/workspace/index.jsp, and this rule properly redirects the user to https:


if (http_uri ends_with "workspace/index.jsp") {
   redirect to "https://%h/%u"
}
else {
   redirect to "https://%h/%uworkspace/index.jsp"
}

The hosting server will only answer if the "workspace/index.jsp" is appended to the host portion. Users can also hit the page by putting in their browser https://host.com/workspace/index.jsp.

The problem comes in when a user only browses for https://host.com. I need help with developing a way for the user to hit the right place using https://host.com. Here is one rule I tried without success:


if (not http_uri ends_with "workspace/index.jsp") {
   redirect to "https://%h/%uworkspace/index.jsp"
}
else {
   use pool workspace
}

On the F5 I have a virtual server 10.x.x.118:80 that points to the first rule. I have an internal virtual server 127.0.x.118:80 that points to the second rule. I have a proxy 10.x.x.118:443 that ties the two together.

Any help is greatly appreciated, thanks!

3 Replies

  • When a user enters www.example.com, the browser automatically appends a trailing slash to the URL and the URI is /. So if you don't want to redirect requests to / to https://%h/%uworkspace/index.jsp, you could add a check for http_uri equals "/".

     

     

    Aaron
  • This worked great! I knew it had to be something simple. Here is the new rule that does exactly what I wanted:

    
    if (http_uri == "/") {
       redirect to "https://%h/%uworkspace/index.jsp"
    }
    else {
       use pool workspace
    }

    Thanks again!