# Rewriting HTTP redirection with HTTPS-\>HTTPS (SSL-to-Server feature) does not func.

**URL:** <https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [August 1, 2007, 5:40pm UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123 "2007-08-01T17:40:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_T\_104445](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jan\_T\_104445](https://community.f5.com/u/Jan_T_104445)\
**Post date:** [August 1, 2007, 5:40pm UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123/1 "2007-08-01T17:40:18Z")

</div>

Dear Developers and Dear Community,

I’ve read many topics in the forum concerning the “rewrite HTTP redirection” feature - always reflecting the “HTTP redirect to HTTPS” case.

None is saying anything about the “HTTPS redirect to HTTPS” case.

I have redirection problems within our websphere application servers, 'cause they are always using the appserver port and never the origin Big-IP SSL proxy port, when sending out redirects.

I know that in other environments/setups, e.g. if using IBM HTTP Server with WebSphere plugin in front ionstead of F5 to achieve lookalike functionallity as Big-IP load-balancing, session stickiness, etc., they have some variables that can influence the appservers behavior:

E.g. WebSphere plugin →

AppServerPortPreference

Specifies which port number the Application Server should

use to build URIs for a sendRedirect.

This field also specifies where to retrieve the value for

HttpServletRequest.getServerPort().

The following values can be specified:

“hostHeader” if the port number from the host header of the

HTTP request coming in is to be used.

“webserverPort” if the port number on which the Web server

received the request is to be used.

So, my question is, how can I do this with Big-IP?

In my setup the following, which is a webapp request for form-based authentication (j\_security\_check is doing a sendRedirect() call), has to be solved:

Request/Response Flow:

1.) Client requests [https://a.b.c/login.html](https://a.b.c/login.html) → Big-IP SSL Proxy → webapp\_https Pool (SSL-to-Server feature) → sends to [https://a.b.c:9443/login.html](https://a.b.c:9443/login.html)

2.) Appserver receives the request + does a “sendredirect()” which leads to a “302” with HTTP LOCATION Header [https://a.b.c:9443](https://a.b.c:9443) wich is unfort. send out to the client.

Any ideas or thoughts are very welcome.

Thanks.

Jan

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [August 3, 2007, 1:26pm UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123/2 "2007-08-03T13:26:15Z")

</div>

Can you try enabling rewrite redirects on the HTTP profile? Try searching for ‘rewrite redirect’ on AskF5 for more information on this feature.

Aaron

---

<div class="post-metadata">

**Author:** ![Jan\_T\_104445](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jan\_T\_104445](https://community.f5.com/u/Jan_T_104445)\
**Post date:** [August 6, 2007, 10:56am UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123/3 "2007-08-06T10:56:17Z")

</div>

Thanks for the information.

But we already tried the “Rewriting HTTP redirecct” option for the SSL proxy configuration (Big-IP Vers. 4.6.2).

Unfort. we had no luck to get it work.

Maybe it has something to do with -\>, that the SSL proxy is not able to do the “rewrite redirect” for SSL (HTTPS) delivered responses. We tried it in many ways, but the “LOCATION” header has always been delivered to the client with the WebSphere Appserver port information and port was not “stripped out” as it should with the “rewriting HTTP reditrect” option enabled.

The doccumentation, concerning the “Rewriting HTTP redirection”, is only talking about redirects for:

1.) Incoming HTTPS traffic which flows to appserver as HTTP, and resulting HTTP response would be redirect as HTTPS to the client.

Question:

Can the same work for HTTPS ↔ HTTPS - only stripping out the port information inserted by the appserver (..or could it not work by design)?

Can somebody give an example of an working example configuration (Steps for SSL-Proxy, virt. Server/IP, HTTPS Pool)?

Any thoughts are very welcome 🙂

Best regards,

Jan

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [August 6, 2007, 11:09am UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123/4 "2007-08-06T11:09:34Z")

</div>

Can you confirm which version of BIG-IP are you running? If 4.x, you should post in the 4.x iRules forum ([Click here](http://devcentral.f5.com/Default.aspx?tabid=53&view=topics&forumid=16)).

Aaron

---

<div class="post-metadata">

**Author:** ![Jan\_T\_104445](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jan\_T\_104445](https://community.f5.com/u/Jan_T_104445)\
**Post date:** [August 6, 2007, 11:50am UTC](https://community.f5.com/t/rewriting-http-redirection-with-https-https-ssl-to-server-feature-does-not-func/1123/5 "2007-08-06T11:50:47Z")

</div>

Aaron,

thanks again for your support.

You are absolutley right. I have posted to the wrong forum.

We are running BIG-IP Vers. 4.5.x., so I reopend the subject in the “iRules - V.4.x” forum.

Jan
