Forum Discussion
Single I-rule with 1000+ URI Redirect
We implemented and it doesn't redirect correctly. Below is I-rule and a sample of Data Group. Would this type of redirect have issue on 10.2.4 Build 655.0 Hotfix HF4? I see I-rule being executed on statistices. Is there any other ways to troubleshoot this?
I-rule
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with redir_dg] } {
HTTP::redirect http://[HTTP::host][class match -value [string tolower [HTTP::uri]]
starts_with redir_dg]
} }
Data Group - redir_dg
/aboutus/ContactUs/index.html := /en/about/contact
/aboutus/news/index.html := /en/about/news
/aboutus/ := /en/about-us
/aboutus/place/index.html := /en/about-us
- ArieJan 29, 2014
Altostratus
Since you're converting [HTTP::host] to lower case, you should convert all the keys (left column) to lower case also. - ArieJan 29, 2014
Altostratus
Observations: 1. "/index.html" = "/", so you'll want to add both to the data group. 2. Using [HTTP::path] is a bit leaner than using [HTTP::uri]. 3. HTTP::redirect generates a 302, which is not cached. It would be better to use HTTP::respond 301 Location http://[HTTP::host][class match -value [string tolower [HTTP::uri]] starts_with redir_dg] 4. Consider using quotation marks around the Location, just in case someone uses spaces or other troublesome characters in the Location. 5. One of the problems with Data Groups is that (depending on how they're updated), updating the DG temporarily makes it unavailable and/or will contain no data or merely a subset of the data. Although the duration of this error condition is brief, it can be problematic. 6. If any other redirects or responses are generated on the connection you'll get an error ("multiple responses"). Code accordingly.
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