Forum Discussion
toofat
Jan 02, 2020Nimbostratus
redirect based on user input urls
I want to redirect all *.web1.com address to *.web2.com
for example,
when user input abc.web1.com,it will be redirect to abc.web2.com
input abcdef.web1.com will be redirect to abcdef.web2.com
and the number of addresses is over 300...
please give me some suggestions
thanks :)
Hi toofat,
Can you try this iRule?
when HTTP_REQUEST { if { [HTTP::host] ends_with "web1.com" } { set newHost [string map {"web1.com" "web2.com"} [HTTP::host]] HTTP::redirect "https://$newHost[HTTP::uri]" } }
Hi toofat,
Can you try this iRule?
when HTTP_REQUEST { if { [HTTP::host] ends_with "web1.com" } { set newHost [string map {"web1.com" "web2.com"} [HTTP::host]] HTTP::redirect "https://$newHost[HTTP::uri]" } }
- toofatNimbostratus
Thank you very very much~~
this is exactly what I want
Thanky you :)
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