Forum Discussion
wrightnz_34708
Jul 08, 2010Nimbostratus
ProxyPass
Hi - hope this is the right place to pose this question
Background:
We are using the ProxyPass irule v10.2 to setup URI shortcode/keyword redirects (rewrites?) e.g. www.123.com/checkthisout...
hooleylist
Jul 12, 2010Cirrostratus
Here is an example which checks the HTTP path (set to lower case for IIS apps) and sends a 301 response based on the datagroup entries you have above. Note that I've removed all checks of the host. If you want to add handling for other hosts, you can put the switch inside a check on HTTP::host. If you want to check if the requested path starts with the strings, you can add the -glob flag to the switch and add a * to the end of the path(s):
switch wiki page
http://devcentral.f5.com/wiki/default.aspx/iRules/switch
when HTTP_REQUEST {
Set the path to lowercase
switch [string tolower [HTTP::path]] {
"/land" {
HTTP::respond 301 Location "/Shows/land/tabid/26/Default.aspx"
}
"/aw" {
HTTP::respond 301 Location "/Shows/Advanced/tabid/45/Default.aspx"
}
"/attack" {
HTTP::respond 301 Location "/Shows/Attack/tabid/14/Default.aspx"
}
"/plenty" {
HTTP::respond 301 Location "/Shows/Plenty/tabid/27/Default.aspx"
}
"/blogs" {
HTTP::respond 301 Location "/Shows/Blogs/tabid/93/Default.aspx"
}
"/op" {
HTTP::respond 301 Location "/Shows/Plenty/tabid/57/Default.aspx"
}
"/derbury" {
HTTP::respond 301 Location "/Shows/derbury/tabid/58/Default.aspx"
}
"/central" {
HTTP::respond 301 Location "/Shows/Central/tabid/29/Default.aspx"
}
"/channel" {
HTTP::respond 301 Location "/Shows/tabid/397/Default.aspx"
}
"/church" {
HTTP::respond 301 Location "/Shows/derbury/tabid/58/Default.aspx"
}
"/events" {
HTTP::respond 301 Location "/Events/tabid/699/Default.aspx"
}
default {
Take some default action?
}
}
}
Aaron
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