Forum Discussion
net::ERR_TOO_MANY_REDIRECTS
Hello,
I am facing challenges with writing an iRule...I have one host that host multiple site ( or pages which is pointing to domino DB).
I have about 15 site, here are few to keep it simple : https://host1.com https://host1.com/newlga.nsf https://host1.com/marine/pullmantursqm.nsf https://host1.com/marine/sqm.nsf https://host1.com/mail/hteam.nsf
iRule is: when HTTP_REQUEST { log local0. "Hi-------------------" set host [string tolower [HTTP::host]] set uri [HTTP::uri] if { $host equals "host1.com" and ( $uri equals "" ) } { set uri "/newlga.nsf/frHomePage?" log local0. "uri = $uri ******* " pool PRD_landedgoods_Pool HTTP::redirect "https://$host$uri" } if { $host equals "host1.com" and ( $uri equals "/newlga.nsf" ) } { set uri "/newlga.nsf/frHomePage" log local0. "uri = $uri ******* " pool PRD_landedgoods_Pool HTTP::redirect "https://$host$uri" } if { $host equals "host1.com" and ( $uri equals "/marine/pullmantursqm.nsf" ) } { set uri "/marine/pullmantursqm.nsf" log local0. "uri = $uri ******* " pool PRD_landedgoods_Pool HTTP::redirect "https://$host$uri" } if { $host equals "host1.com" and ( $uri equals "/marine/sqm.nsf" ) } { set uri "/marine/sqm.nsf" log local0. "uri = $uri ******* " pool PRD_landedgoods_Pool HTTP::redirect "https://$host$uri" } if { $host equals "host1.com" and ( $uri equals "/mail/hteam.nsf" ) } { set uri "/mail/hteam.nsf" log local0. "uri = $uri ******* " pool PRD_landedgoods_Pool HTTP::redirect "https://$host$uri" } }
the first two urls works fine and bring up the corresponding page, however all the rest , throws this erro: This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS
thank you for your help in advance.
8 Replies
- kunjan_118660
Cumulonimbus
You don't need a redirect that creates the loop. Setting the URI and pool is enough if I undertand the requirement correctly. You might be able to simplify with switch cmd.
when HTTP_REQUEST { log local0."Hi-------------------" set host [string tolower [HTTP::host]] set uri [HTTP::uri] if { $host equals "host1.com" and ($uri equals "") } { set uri "/newlga.nsf/frHomePage?" log local0. "uri = $uri ******* " HTTP::uri $uri pool PRD_landedgoods_Pool } ............. }- Jaz_170005
Nimbostratus
thank you.. that worked for me.
- kunjan
Nimbostratus
You don't need a redirect that creates the loop. Setting the URI and pool is enough if I undertand the requirement correctly. You might be able to simplify with switch cmd.
when HTTP_REQUEST { log local0."Hi-------------------" set host [string tolower [HTTP::host]] set uri [HTTP::uri] if { $host equals "host1.com" and ($uri equals "") } { set uri "/newlga.nsf/frHomePage?" log local0. "uri = $uri ******* " HTTP::uri $uri pool PRD_landedgoods_Pool } ............. }- Jaz_170005
Nimbostratus
thank you.. that worked for me.
- nitass_89166
Noctilucent
this is switch example.
/marine/pullmantursqm.nsf, /marine/sqm.nsf and /mail/hteam.nsf uri are not changed, so i removed them from switch pattern. also, i removed pool because all uris are sent to the same pool (i.e. pool can be assigned to virtual server).
when HTTP_REQUEST { if { [HTTP::host] equals "host1.com" } { switch [string tolower [HTTP::uri]] { "/" { HTTP::uri "/newlga.nsf/frHomePage?" } "/newlga.nsf" { HTTP::uri "/newlga.nsf/frHomePage" } } } }- Jaz_170005
Nimbostratus
this works too..thank you
- nitass
Employee
this is switch example.
/marine/pullmantursqm.nsf, /marine/sqm.nsf and /mail/hteam.nsf uri are not changed, so i removed them from switch pattern. also, i removed pool because all uris are sent to the same pool (i.e. pool can be assigned to virtual server).
when HTTP_REQUEST { if { [HTTP::host] equals "host1.com" } { switch [string tolower [HTTP::uri]] { "/" { HTTP::uri "/newlga.nsf/frHomePage?" } "/newlga.nsf" { HTTP::uri "/newlga.nsf/frHomePage" } } } }- Jaz_170005
Nimbostratus
this works too..thank you
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com