Forum Discussion
Troy_94246
Nimbostratus
Jan 27, 2014Single I-rule with 1000+ URI Redirect
We are working on a Web site refresh and have been asked to use Big IP to redirect over 1000 pages based on URI to a different URI on same page. We have different options to do this with I-rule but I...
Troy_94246
Nimbostratus
Jan 29, 2014We 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
Arie
Altostratus
Jan 29, 2014Observations:
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.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects