iRule for https redirect - redirects every URL back to homepage

I’ve setup an iRule to redirect https://www.aibgb.aibtest.ie to https://aibgb.aibtest.ie. The problem is that when I try to access https://www.aibgb.aibtest.ie/ibhelp it gets redirected to https://aibgb.aibtest.ie instead of https://aibgb.aibtest.ie/ibhelp

What do I need to modify in my iRule so it keeps the additional folder suffixes and not direct every URL with the domain name in it back to the homepage as it is currently doing?

Here is my irule;

when HTTP_REQUEST { if { ([HTTP::host] equals “www.aibgb.aibtest.ie”) } { HTTP::redirect “https://aibgb.aibtest.ie” } }

What about something like this:

when HTTP_REQUEST { 
    if {[string tolower [HTTP::host]] equals "www.aibgb.aibtest.ie" } { 
    HTTP::respond 301 Location "https://aibgb.aibtest.ie[HTTP::uri]" 
 } 
}

See if this works for you.

N

Add [HTTP::uri] to your redirect.

yes right Add [HTTP::uri]

I tried this but it didn’t work for me.