Forum Discussion
Joe_Curl_105786
Nimbostratus
Aug 31, 2009Multiple Web Pages on single server
I have a case where I have two web pages that are hosted on the same web server. The first application is /index.jsp, and the second is /pkl/index.jsp. I am trying to figure out how to get the traffic to the right directory based on the url.
Site 1 site1.portal.hca.com to /index.jsp
Site 2 iphone.portal.hca.com to /pkl/index.jsp
Any help is appreciated.
Joe
- L4L7_53191
Nimbostratus
Joe: would it be enough to just switch on the HTTP::host portion of the request? If so, something like this may work for you:when HTTP_REQUEST { switch [string tolower [HTTP::host]] { site1.portal.hca.com { pool site1-pool } iphone.portal.hca.com { pool iphone-pool } default { pool default-pool } } }
- The_Bhattman
Nimbostratus
Hi Joe, - Joe_Curl_105786
Nimbostratus
We looked at doing this on the server side and because of the way the application is done, it does not seem to be an option. One other idea that came up was to somehow identify if the request is coming from an iPhone then send it to the page that is hosted in the /pkl/ directory. This would make it easier in that we just have one URL and we just send them to the right page based on what type of device it is. - Joe_Curl_105786
Nimbostratus
Here is something I put together. Let me know if anyone has any better ideas or suggestions. - L4L7_53191
Nimbostratus
Joe: I think that last rule may cause a redirect loop - every time the user-agent is iphone you'll redirect...you may want to add some extra logic to account for that.
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