Rewirte Java URL

We have an irule using Stream Expression to redirect http requests to https and remove port number (9510). It works great with images but not for java. When we click on a link that launches Java app, it does not redirect to https correctly. It should redirect from to

We are using IBM TM1 software and can’t modify java script code.

Content type is application/x-www-form-urlencoded. I don’t know if it makes a difference.

IRULE script

when HTTP_REQUEST {

STREAM::disable

HTTP::header remove “Accept-Encoding”

}

when HTTP_RESPONSE {

set url_01 “”

set replace_url_01 “”

STREAM::expression “@$url_01@$replace_url_01@”

STREAM::enable

}

Output from Fiddler

POST HTTP/1.1

Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, /

Accept-Language: en-US

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8)

Content-Type: application/x-www-form-urlencoded

Accept-Encoding: gzip, deflate

Connection: Keep-Alive

Content-Length: 713

Host: server01:9510

Pragma: no-cache

Cookie: BIGipServerserver01.app~server01_pool=893954570.9765.0000

Could someone help me out?

Thanks in advance