I have users entering/opening a link to https://site.domain.com/UrgentAlerts/{num} and it needs to be redirected to https://site2.domain.com/sites/EmployeePortal/News/_layouts/EmployeePortalMain/go.aspx?C={num}.
My appdev guys say it has to be a 302 redirect. Just wondering how this can be done with an irule. Its a sharepoint site if that helps anything.
i also have to clarify that the “{num}” is a number that changes each time.. example: https://site.domain.com/UrgentAlerts/{7} turns into https://site2.domain.com/sites/EmployeePortal/News/\_layouts/EmployeePortalMain/go.aspx?C={7}. this time its 7 and next time it can be 8 etc…
you could try something like this
when HTTP_REQUEST {
if {[string tolower "[HTTP::host][HTTP::uri]"] starts_with "site.domain.com/urgentalerts/"} {
HTTP::respond 302 Location "[string map -nocase {"site.domain.com/UrgentAlerts/" "https://site2.domain.com/sites/EmployeePortal/News/_layouts/EmployeePortalMain/go.aspx?C="} "[HTTP::host][HTTP::uri]"]"
}
}