Forum Discussion
iRule not working properly
Hi,
Here's my virtual server,
Here's my default pool,
here's my pool members,
Then I have created following iRule and have assigned it to the virtual server.
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/api/" } { pool API.Access } }
when HTTP_RESPONSE { if { [HTTP::is_redirect] } { foreach aCookieName [HTTP::cookie names] { set currentCookie "$aCookieName=[HTTP::cookie value $aCookieName]" set cookies "$cookies\r\nSet-Cookie: $currentCookie" } HTTP::respond 200 content "\ The server is trying to redirect the client to an external site, but it is forbidden" Set-Cookie $cookies } }
Here's the pool called API.Access
Here's it's members,
My URL looks like this,
http://portal.mydomain.com
However I want them to be redirected to the API.Access pool when the URL looks like this,
http://poral.mydomain.com/api/help
When I add my iRule, it does work for http://poral.mydomain.com/api/help but not for http://poral.mydomain.com.
Can you please point me in the right direction?
Many thanks.
5 Replies
- Thomas_Gobet_91
Cirrostratus
Hi,
What's wrong when you go to http://poral.mydomain.com ?
- test_user_14481
Nimbostratus
It just shows me a page can not be displaced message
- Thomas_Gobet
Nimbostratus
Hi,
What's wrong when you go to http://poral.mydomain.com ?
- test_user_14481
Nimbostratus
It just shows me a page can not be displaced message
- test_user_14481
Nimbostratus
Setting HTTP Profile fixed this issue on the virtual server
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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