Hi Shafiul,
you may try the iRule below...
when HTTP_REQUEST {
if { ( [string tolower [HTTP::path]] starts_with "/somecontent/" ) and ( [HTTP::path] ends_with "/" ) } then {
if { [HTTP::query] eq "" } then {
HTTP::respond 301 "Location" "https://[getfield [HTTP::host] ":" 1][string range [HTTP::path] 0 end-1]"
} else {
HTTP::respond 301 "Location" "https://[getfield [HTTP::host] ":" 1][string range [HTTP::path] 0 end-1]?[HTTP::query]"
}
} else {
Request to other base directory or a path without trailing / detected
}
}
Note: The iRule can be used for HTTP and HTTPS access as well.
Cheers, Kai