Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Client Browser URL manipulation

mj16othman
Altostratus
Altostratus

Dears 

 

I have a request. I hjave clients trying to access the  URL  "https://abc.com:7443" but i want to remove the :7443 from the URL after the backend server response to the request and the URL to look like this "https://abc.com"

 

Ive tried everything with an irule but its not working 

when HTTP_RESPONSE {


if {[HTTP::host] contains ":"}{

HTTP::redirect "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}

1 REPLY 1

Snl
Cirrostratus
Cirrostratus

give a try

 

when HTTP_REQUEST {
    HTTP::header remove Accept-Encoding
    STREAM::disable
}
when HTTP_RESPONSE {
    if { [HTTP::header exists Location] } {
        HTTP::header replace Location [string map -nocase {"abc.com:7443" "abc.com"} [HTTP::header Location]]
    }

    if { [HTTP::header Content-Type] contains "text" } {
        STREAM::expression {@abc.com:7443@abc.com@}
        STREAM::enable
    }
}