Redirect to mobile subdomain using 51degrees

I am using 51degrees API to redirect mobile devices: http://51degrees.codeplex.com/

When a mobile device using 51degrees is detected, I can redirect from any desktop page to the mobile homepage using only the 51degrees configuration. That is http://www.mydomain.com/somepage at http://m.somepage.com/default .

What I cannot do is redirect to the same page, i.e. from http://www.mydomain.com/somepage to http://m.somepage.com/somepaage .

Can I redirect to the same page?

+5
source share
2 answers

Option 1 . Use only 51 deducts for the mobile device discovery part and enable redirection yourself. Remove the element <redirect>from your web.config and try something like this in the Global.asax file:

void Application_BeginRequest(object sender, EventArgs e)
{
    if (HttpContext.Current.Request.Browser.IsMobileDevice)
    {
        Response.Redirect("http://m.mydomain.com" + Request.RawUrl);
    }
}

2. <redirect> web.config originalUrlAsQueryString=true. origUrl , .

+5

, 2.1.2 51Degrees.mobi ..

0

All Articles