Forum Discussion
Joe_Pipitone
May 13, 2010Nimbostratus
Hi 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]" }
}
}