Alexis_Verb__23
Jul 01, 2011Nimbostratus
Irule redirect --> problem with character "#"
Hello,
I'm facing trouble with creating a simple redirect irule. I want to redirect everthing from http://mywebsite.com/{sth} to http://www.mywebsite.com/{sth}.
Here is the irule I've written :
when HTTP_REQUEST {
if { [HTTP::path] equals "/" and
([HTTP::header "User-Agent"] contains "iPhone"
or [HTTP::header "User-Agent"] contains "iPod"
or [HTTP::header "User-Agent"] contains "Android"
or [HTTP::header "User-Agent"] contains "Apple Mobile Safari")} {
HTTP::respond 301 "Location" "http://mobile.mywebsite.fr/news/"
}
elseif { [HTTP::host] equals "mywebsite.fr" }{
HTTP::respond 301 "Location" "http://www.mywebsite.fr[HTTP::uri]"
}
else {
pool mywebsite-pool
}
}
Anayway, in the [HTTP::uri], I often have the "" character, and it does not work.
Example :
If I try with http://mywebsite.fr//test I am redirected to http://www.mywebsite.fr/.
Does anyone know how to deal with that?
Thanks a lot,
Alexis.