irule redirect to different uri
Hi,
i need help to redirect:
https://www.abc.com/App/Topics/Topic.aspx?TopicId=* redirect to https://abc.com/redirect-legacy/abc-topics/Topic.aspx?TopicID=*
the below are two examples:
https://www.abc.com/App/Topics/Topic.aspx?TopicId=87
should go to
https://abc.com/redirect-tolegacy/abc-topics/Topic.aspx?TopicID=87
https://www.abc.gov/App/Topics/Topic.aspx?topicid=121
should go to
https://abc.com/redirect-tolegacy/abc-topics/Topic.aspx?TopicID=121
My below irule with string map is not working correctly.
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] eq "www.abc.com") and ( [HTTP::uri] starts_with "/App/Topics/Topic.aspx?")} {
HTTP::respond 301 noserver Location "https://www.abc.com[string map {/App/Topics/ /redirect-tolegacy/abc-topics/} [HTTP::uri]]"
}
}
Any help i appreciate.
Thanks