Forum Discussion
Debbie_123533
Nimbostratus
Oct 24, 2013Redirect
I have a very simple redirect I want to create but can't seem to get my syntax correct.
All I want to do is redirect Http://website1 to http://website2
How do I do this with a simple iRule?...
Matt_Dierick
Employee
Oct 24, 2013Humm, try this
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "website1" && not ([string tolower [HTTP::uri]] starts_with "/app")} { HTTP::redirect "http://website2" } else { return } }
But be careful. All objects in /app must stay in /app in your website. Else objects will be redirected to website2.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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