URI Masking if there's multiple redirects
Hi Folks,
I went through a lot of articles in devcentral, but all I could find was for single URI masking without multiple redirects. I have this below requirement.
End User should access and always see --> https://abc.com but the content of https://abc.com/article12
Should not see the URI path's or even track it.
There is a content hosted in URI --> /article12 (So its like https://abc.com/article12) When https://abc.com/article12 is accessed, it redirects to 4-5 different set of URI's. Like I have multiple 302's to reach the end result. Finally I see the content from https://abc.com/article12/libs/granite/core/content/login.html?abcxyzreason=unknown&j_reason_code=unknown
So to achieve 1st requirement I used HTTP_REQUEST, accessing abc.com should goto /article12. But its going on loop.
when HTTP_REQUEST {
if { [HTTP::host] eq "abc.com" } {
HTTP::uri /article12/
}
}
I tried to go with the below HTTP Response Irule, but its also going on loop.
when HTTP_RESPONSE {
if { [HTTP::is_redirect] && [HTTP::header Location] contains "/article12" } {
HTTP::header replace Location [string map -nocase "/article12 /" [HTTP::header Location]]
}
}