Deploy Application Using Load Balancer

I have fairly large application that uses sub-domain as pointer to modules like this. However, I am using load balancer for my application. Problem is if I directly hit web-server then it works but if I hit application server via load balancer then it does not work. In YII community does anybody have any experience in deploying application with load balancer (with Parametrized URL used preferably). Any help will be highly appreciated.

I want to deploy my Yii application in two web servers. I just got an idea: resolve load balancing through the links. That is, I will configure two web servers:

Web server 1 with two domains: www.mydomain.com and ws1.mydomain.com

Web server 2 with one domain: ws1.midominio.com

Then, if a page contains five links, their URLs will be, for example:

http://ws1.mydomain.com/index.php

http://ws2.mydomain.com/index.php

http://ws1.mydomain.com/index.php

http://ws2.mydomain.com/index.php

http://ws1.mydomain.com/index.php

I was wondering if this solution may has any problem. Tecnically, I don’t see any problem, but maybe with search engines. What do you think?