Forum Discussion
eesgro_26208
Nimbostratus
Aug 12, 2010URI rewrite question
To all,
I am no means an iRule programmer. I a merely an administrator of the LTM.
Anyhow here is my situation.
We have a website that people access via dummywebsite.com/uri/moreuri/evenmoreuri/default.htm
I need the F5 to redirect the client to www.dummywebsite.com/uri/moreuri/evenmoreuri/default.htm
I have read through some posts and determined it sounds more like a header rewrite and based off of those various posts compiled the following iRule. Is this accurate for what I am trying to achieve?
when HTTP_REQUEST {
if {[HTTP::header] eq "dummywebsite.com"}{
HTTP::header replace "www.dummywebsite.com"
}
}
Thank you! Ed
- Chris_Miller
Altostratus
This is how I'd do it:when HTTP_REQUEST { if { [HTTP::host] eq "dummywebsite.com" } { HTTP::redirect "http://www.[HTTP::host][HTTP::uri]" } }
when HTTP_REQUEST { if { [HTTP::host] eq "dummywebsite.com" } { HTTP::redirect "http://www.dummywebsite.com[HTTP::uri]" } }
- naladar_65658
Altostratus
It very well could be, I do not know. I am sure there is an RFC out there that recommends it SHOULD be treated as lower case... I don't think it is much of a performance hit in my environment so I turn it on to be safe. I use it a lot when I am working on URI's as well. - Chris_Miller
Altostratus
Posted By naladar on 08/13/2010 06:56 AM
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