Puli
Nov 18, 2009Nimbostratus
migrate apache redirects to iRule
Hi ,
need hep in migrating our apache redirects to an iRule.
We have about 600 redirects setup in apache.
Am looking for a generic iRule to handle all 600.
The apache redirect vary based on the host.
For example:
Scenario 1: Redirect to a particular page
ServerName abc.foo.com
RedirectMatch 301 ^/(.*) http://newsite.foo.com/us/abc/index.html
We have about 400 of these with differrent ServerNames
Scenario 2 : Rewrite Rules
ServerName abc.foo.com
RewriteEngine On
RewriteRule ^/support/docs(.*) http://newsite.foo.com/adc/support/docs [R=301]
RewriteRule ^/support(.*) http://newsite.foo.com/adc/support [R=301]
RewriteRule ^/(.*) http://newsite.foo.com/adc [R=301]
have about 100 differrent ServerNmaes of these type
Scenario 3 : RedirectMatch
ServerName abc.foo.com
RedirectMatch 301 ^/(.+)$ http://newsite.foo.com/adc/en/$1
RedirectMatch 301 ^/servers/(.*)$ http://newsite.foo.com/adc/servers/$1
RedirectMatch 301 ^/(.*)$ http://newsite.foo.com/adc
have about 100 differrent ServerNmaes of these type
All our apache redirects fall into one of above scenarios.
Can you please help me write a generic iRule to handle all of them.
thanks. appreciate you help
Venu.