Forum Discussion
Need help with an irule to redirect with exceptions for certain pages
Below is the code that is working perfectly for one of the sites, however for some reason it won't work when I apply it to another site that has about 8 lines of matches, any thoughts?
when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/clocks.asp" - "/includes/" - "/favicon.ico" - "/images/" { pool www-distribution_pool } default { HTTP::respond 301 location "http://www.mysite.com/Distribution.aspx" } } }
Here is the longer match code that does not seem to work (it just redirects everything no matter what I do):
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] { "/news/" - "/favicon/" - "/links/" - "/downloads/" - "/offices/" - "/programs/" - "/selling/" - "/wear/" - "/links/" - "/images/" { pool www-landing_pool } default { HTTP::respond 301 location "http://www.myothersite.com/landing.aspx" } } }
Lastly, would it be better to use a datagroup for a longer list like that? I tried to do so but could not get that to work either. As before, ANY help appreciated!
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