You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ABHISHEK GUPTA <gu...@gmail.com> on 2012/11/01 05:59:08 UTC
[users@httpd]
Hello Group,
I want to configure apache in a way that all the request from mobile
browsers are redirected to a separate virtualhost and requests from desktop
browsers are served from another virtualhost.
Please help.
Regards
Abhishek.
Re: [users@httpd]
Posted by ABHISHEK GUPTA <gu...@gmail.com>.
Thanks, Kevin.
On Thu, Nov 1, 2012 at 10:42 AM, Kevin A. McGrail <KM...@pccc.com> wrote:
> On 11/1/2012 12:59 AM, ABHISHEK GUPTA wrote:
>
>> I want to configure apache in a way that all the request from mobile
>> browsers are redirected to a separate virtualhost and requests from desktop
>> browsers are served from another virtualhost.
>>
>
> Abhishek,
>
> Because I recommend that the mobile site have a choice to choose to view
> the full site, this is likely best handled on the full site with a user
> agent check that then redirects to the mobile site coupled with a cookie
> check.
>
> However, mod_rewrite would be the likely answer based on user agent if you
> wanted to implement it that way. http://httpd.apache.org/docs/**
> 2.4/rewrite/access.html<http://httpd.apache.org/docs/2.4/rewrite/access.html>has an example access control with user agent but instead using the
> condition to redir with a rule such as (untested):
>
> RewriteCond %{HTTP_USER_AGENT} ^iPad
> RewriteRule ^(.*) http://mobile.mysite.com/$1 [L,R=permanent]
>
> Regards,
> KAM
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.org<us...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd]
Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 11/1/2012 12:59 AM, ABHISHEK GUPTA wrote:
> I want to configure apache in a way that all the request from mobile
> browsers are redirected to a separate virtualhost and requests from
> desktop browsers are served from another virtualhost.
Abhishek,
Because I recommend that the mobile site have a choice to choose to view
the full site, this is likely best handled on the full site with a user
agent check that then redirects to the mobile site coupled with a cookie
check.
However, mod_rewrite would be the likely answer based on user agent if
you wanted to implement it that way.
http://httpd.apache.org/docs/2.4/rewrite/access.html has an example
access control with user agent but instead using the condition to redir
with a rule such as (untested):
RewriteCond %{HTTP_USER_AGENT} ^iPad
RewriteRule ^(.*) http://mobile.mysite.com/$1 [L,R=permanent]
Regards,
KAM
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org