Forum Discussion
Bob_10976
Jun 07, 2012Nimbostratus
Odd WWW Redirect and Uppercase issue..
Hello all, I've got an odd issue with one redirect not working and it seems because the URI has uppercase in it.I have a couple of redirect in place which is below but the problem is if I go to http://www.mydomain.com/Portal/OrgList.aspx it won't redirect however if I use http://www.mydomain.com/portal/orglist.aspx it will.
This is www redirect rule:
when HTTP_REQUEST {
switch "[string tolower [HTTP::host]]" {www.mydomain.com {
HTTP::respond 301 Location "http://mydomain.com[HTTP::uri]"
}
}
}
This is the specific section of URI redirect rule:
elseif { [string tolower [HTTP::uri]] starts_with "/portal/orglist.aspx" } {
HTTP::respond 301 Location http://mydomain.com/government/pages/agency.aspx
}
I even tried changing the "starts_with" to Equals but didn't change anything, and I attempted to remove the [string tolower... section but I get an error indictating that is not a vaild rule.
Any suggestions or thoughts on what I'm doing wrong?
Thanks,
Bob
- Michael_YatesNimbostratusHi Bob,
when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "www.mydomain.com" { if { [string tolower [HTTP::uri]] ends_with "/portal/orglist.aspx" } { log local0. "Qualified Match: [HTTP::uri]" HTTP::respond 301 Location "http://www.google.com" } } } }
- ArieAltostratusYour snippet contains "elseif". Is it possible that there's another condition that is being met earlier in the code?
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