1

I want to create a mobile version of an existing desktop page. I made copy of my pages and used this code for detecting mobile device :

 public void Page_Load(Object sender, EventArgs e) 
{
    if (Request.Browser["IsMobileDevice"] == "true" ) 
    {
        Response.Redirect(@"~/Content/PageXmobile.aspx");
    }
    else 
    {
        Response.Redirect("PageX.aspx");
    }
}

PageXmobile.aspx is a copy of PageX.aspx except that PageXmobile.aspx is formatted for mobile device but the content is the same on both pages. How to solve this duplication issue?

2 Answers 2

1

Be sure to use canonical meta tags or HTTP headers.

Add the following meta tag within both pages and point it to the desktop or primary version:

<link rel="canonical" href="http://www.example.com/article-page" />

You can also send the following HTTP Header along with the request as an alternate way of providing the canonical page:

Link: <http://www.example.com/article-page>; rel="canonical"
0

If the mobile site is not placed on a subdirectory or if there's no mobile counterpart page (example.com/page1.asp / m.example.com/page1.asp), no need to use the <link rel="canonical" href="https://m.example.com/page1.asp"/>.

If they are separate pages, use the rel="canonical" attribute and don't forget to add mirror or copy the same meta title and description from the main website to the mobile site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.