Forum Discussion
Feb 05, 2010
One Vs for Redirects
This should be an easy one..
I want to use one VS for a bunch of redirects, a catch all of sorts.. If for some reason this is a bad idea just let me know.
The redirect on...
Justin_Adrian_3
Nimbostratus
Mar 09, 2010Not sure if you are done with this, but I built this little irule to do a similar function. I wanted to avoid having to modify one massive data set. Thought that smaller data sets that could be added as needed would work better.
Master Vanity IRule
Created 8/5/09 by Justin Adrian
This iRule is built to redirect header requests
It will take the host name and look for a data set
with the following name VURL_host.domain.com
The data set should have a string value of the redirect
when HTTP_REQUEST {
log local0.info [findclass "http" [set ::VURL_[HTTP::host]]]
redirect to URL in data set
HTTP::redirect [findclass [string tolower [HTTP::uri]] [set ::VURL_[string tolower [HTTP::host]]] " "]
}
Then for each new site/redirect that I create, I create a data set like below.
The name includes VURL then the actual host string.
The string is built with what you are matching on, and then the corresponding redirect.
I have successfully had this work with 150 matches with unique redirects in a single data set.
class VURL_mx.test.com {
"/ https://mx.test.com/testclaimapp?whr=badstuff"
}
class VURL_mytest.test.com {
"/ https://mytest.test.com/administration/Default.aspx"
}
class VURL_pretest.test.com {
"/ https://pre.test.com/opensso/WSFederationServlet/metaAlias/tdcauthweb?goto=https://sso-stage.test.com/opensso"
}
class VURL_tgpp.test.com {
"/ https://kxo.test.com/Organizations/Pages/SIandT-Podcasts.aspx"
}
-J
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
