Forum Discussion
Joe_Pipitone
Nimbostratus
May 12, 2010More conflicts with redirect iRule
I am getting the following error with the iRule below. Something about no such variable when executing. Perhaps this is because there is no URI sometimes if the user requests the homepage? Can anyo...
Joe_Pipitone
Nimbostratus
May 13, 2010Hi guys - here's an update.
I'm trying to use the following code that you've provided above. (I've modified it again to hide our real URLs) Note I've added a survey and a survey/ with a trailing / as our CMS application automatically appends an .aspx unless we do so. I tried to make this as clear as possible - thanks for your help so far.
This partially works:
- If I go to http://www.oursite.com/survey or http://www.oursite.com/survey/, I get redirected to our homepage (http://oursite.com/Home.aspx)
- If I go to http://oursite.com/survey or http://oursite.com/survey/, I get redirected properly.
- It doesn't seem to want to rewrite properly without the www if I go to http://www.oursite.com/surveys/ either, however I see the proper page.
- If I go to http://www.oursite.com/images, I get a "The connection was reset" in my browser.
- If I go to http://oursite.com/images, I get redirected properly.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.oursite.com" } {
HTTP::redirect "http://oursite.com"
}
switch -glob [ string tolower [HTTP::uri]] {
"/survey" -
"/survey/" { HTTP::redirect "http://[HTTP::host]/surveys/" }
"/images*" { HTTP::redirect "http://legacy.oursite.com[HTTP::uri]" }
}
}
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