14-Jan-2021 05:33
I need help to redirect the URLs
https://web.example.com
https://web.example.com/Site/
https://web.example.com/site/
https://web.example.com:9443/
https://web.example.com:9443/Site/
https://web.example.com:9443/site/
to
https://web.example.com:9443/Site/
17-Jan-2021
01:31
- last edited on
04-Jun-2023
21:06
by
JimmyPackets
,
Now as you want redirection on port 443 as well as 9443, so you would need two separate virtual servers using same IP (which is associated with web.example.com) which will be listening on both these ports. You can also have single virtual server which will listen on both ports using port list option.
First 3 redirection will be carry out by virtual server which is listening on port 443 and remaining redirections will be done by virtual server which is listening on port 9443.
You can bind below iRule to each of the virtual server for the redirection.
when HTTP_REQUEST {
if { [HTTP::host] contains "web.example.com"}{
if { ([HTTP::uri] equals "/") || ([HTTP::uri] equals "/Site") || ([HTTP::uri] equals "/site")}{
HTTP::redirect https://web.example.com:9443/Site/
}
}
}
Hope it helps!
Mayur