On 10/4/2012 9:01 PM, Abhishek Gupta wrote:
> Dear group,
>
> I want to run two sites (desktop and mobile version) under same server.
>
> I want apache to proxy/redirect to appropriate application server based on
> user agent (msie/ipad).
>
> Currently, only desktop version is running and I am using proxypass directive.
Hello, Abhishek;
You could switch to rewrites with [P]. You will still need
proxypassreverse to cover any redirects.
BrowserMatchNoCase ^.*iPhone.*$ mobilebrowser=true
BrowserMatchNoCase ^.*iPad.*$ mobilebrowser=true
BrowserMatchNoCase ^.*Android.*$ mobilebrowser=true
RewriteEngine On
RewriteCond %{ENV:mobilebrowser} true
RewriteRule /(.*) http://mobile.backend.com/$1 [P,L]
RewriteRule /(.*) http://desktop.backend.com/$1 [P]
ProxyPassReverse / http://mobile.backend.com/
ProxyPassReverse / http://desktop.backend.com/
Even the browsermatch directives are not required - you could use
additional conditions like...
RewriteCond %{HTTP_USER_AGENT} .*iPad.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} .*iPhone.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} .*Android.* [NC]
<the rest...>
--
Daniel Ruggeri
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]