65,000 character limit in irule and URI redirects
Hi all,
I've been asked to do something and the way I thought I could do it isn't working (and probably isn't the best way to go about it)
We have 2 domains (domain1.net.com an domain2.org.info).
Domain1.net.com is closing down and we want to use 301 redirects to domain2.org.info. I've been asked to redirect over 1000 unique URI's on domain1.net.com to unique URI's on domain2.org.info.
I thought I could write an irule with an if statement listing out all the unique URI's but when I uploaded the irule to the F5 I received an error that the irule character limit didn't allow it.
Is there a way I can easily do this?
Example of my irule is below
when HTTP_REQUEST {
if { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri] contains "<UNIQUE/STRING>"} {
HTTP::redirect "https:/domain2.org.info/UNIQUE/URI/GOES/HERE/"
}
elseif { [HTTP::uri]..............
and so on. As mentioned, there are over 1000 unique URI's on domain1 that they want to redirect to unique URI's on domain2
Happy for any advice.
Thanks
Use an external datagroup to store your translations,
K73862425: Creating external data groups
Your irule looks up the key, and redirects to the value indexed by the key.