Forum Discussion
iRule won't redirect on 404
Hello everyone. Very novice when it comes to iRule writing, especially considering half the time I just patch together stuff I find on here from you people who know what you're actually doing. Anyhoo...
I've got an iRule that has been working fairly well for redirecting folks who are going to a specific URI for SharePoint 2007, and then intercepts and sends them to the corresponding 2010 site. The iRule looks like the below:
when HTTP_REQUEST {
set group $::group_sharepoint2010
set redirect http://share2010.generic.com
set uri [HTTP::uri]
set lower_uri [string tolower [HTTP::uri]]
if { [matchclass $lower_uri starts_with $group] } {
log local0. "site match - the http_uri is [HTTP::uri] - redirecting to $redirect$uri"
HTTP::redirect $redirect$uri
}
}
The group "group_sharepoint2010" has the following in it as an example:
"/sites/abcd"
"sites/efgh"
So what I would expect for it to do is when somebody sends a request to a VIP that has the rule applied in the form of "share07.generic.com/sites/abcd", that it would then redirect them to "share2010.generic.com/sites/abcd".
This was actually working fairly well, until we shut down some of the SharePoint2007 sites, and now when the user tries to hit the 2007 site, instead of being redirected to the 2010 site, they get a 404 from the old site.
Any help at all would be appreciate!
2 Replies
- Kevin_Stewart
Employee
Just spitballing here, but you may want to throw in a few additional log statements to see what the client is requesting. Also, which TMOS version? - rob0030_110553
Nimbostratus
Kevin, thanks for the response, but we weren't able to wait and engaged F5 support and fixed the issue. Thanks again!
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