javascripthttp-redirectmobileseo

Redirect to mobile site based on user agent - what is impact on SEO?


I want to redirect my mobile site users to mobile specific pages in case the request has been originated from mobile device. I can write below code near HTML Head tag in JS to figure out this.

if(Check UserAgent is Mobile)
{
    mobile=true;
    window.location.assign("http://example.com"+"&mobile="+mobile);

}

If mobile parameter is available in HTTP params then I can implement certain logic.

Will it cause any issue with respect to SEO?


Solution

  • Search engines will consider your mobile page(s) as duplicate content once the alternative URLs get spread (unless search engines actually do check mobile redirects, in which case it'll consider it duplciate earlier).

    Consider responsive design instead of UA sniffing. If you're unable to do so, read into rel=canonical and apply it to your mobile pages.