URL Rewrite iRule Help Requested
Hi All,
Would appreciate if someone help me in verifying the following iRule..
My Requirement is that I have 2 URLs which resolves to the same IP address, the rewrite should take effect based on the URL.
dms-pd.abc.com and dms-dev.abc.com resolves to IP address 1.2.3.4
- If domain/host is dms-pd.abc.com, then redirect to http://10.10.10.1:50005/sap/
- If domain/host is dms-dev.abc.com, then redirect to http://10.10.10.2:8000/sap/
iRule Created and needs verification:
rule vip-1.2.3.4-irule { when HTTP_REQUEST { if { [HTTP::uri] == "/" } { HTTP::redirect "http://[HTTP::host]/irj/portal" } elseif { [string tolower [HTTP::uri]] starts_with "/irj" or [string tolower [HTTP::uri]] starts_with "/webdynpro" or [string tolower [HTTP::uri]] starts_with "/rtmfCommunicator" } { pool pool-10.10.10.10-50000 } elseif { ([HTTP::host] equals "dms-pd.abc.com") and ([HTTP::uri] starts_with "/sap") } { pool pool-10.10.10.1-50005} elseif { [string tolower [HTTP::uri]] starts_with "/sap" } { pool pool-10.10.10.2-8000}