Forum Discussion
Annsar_Akhtar
Nimbostratus
Sep 21, 2012Irules redirect/rewrite query
Hi all
I am new to the irules forum, and have been looking for the best way to handle a request come from our development team.
The request is as following, currently users browse to http:/...
Kevin_Stewart
Employee
Sep 24, 2012How about something like this then:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.test.com" } {
sample http://www.test.com/destination/xyz
set firstpart [string range [HTTP::uri] 0 [expr [string last "/" [HTTP::uri]] -1]]
set secpart [string range [HTTP::uri] [string last "/" [HTTP::uri]] end]
log local0. "firstpart = $firstpart"
log local0. "secpart = $secpart"
HTTP::redirect "http://www.test2.com$firstpart$secpart"
}
}
What do you mean by " also to rewrite it back to the orginal url to maintain SEO"?
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