I have a phpBB forum with a skin for mobile users. Some javascript detects your device/resolution and sends you to the mobile skin or not. The URLs remain the same, it is based on a cookie.

People that are on a larger screen, can still choose to use the mobile skin, by pressing a button that will send them to example.com/current_page?mobile=mobile.

I have 2 problems with this:

  1. Duplicate pages on Google. I do not see any doubles popping up yet, but it is bound to happen right?
  2. Sometimes Google indexes the mobile link. This causes desktop users to go to the mobile skin automatically and is certainly not intended functionality.

Will disallow *?mobile=mobile in robots.txt solve my problem?

Can disallowing the parameter in GWT help? The parameter does not change the content, only the layout, so I can put it on ignore, but will (could) it help with my problem?

  • Can't you use a cookie instead of the mobile query string? Jul 21, 2014 at 11:04
  • I didn't write it myself, and I would rather fix it through GWT or robots.txt or the like than trying to figure out how it works exactly. I barely know php too. Jul 21, 2014 at 20:53

3 Answers 3


Canonical links to the rescue

There's no need to use robots to block urls that are used by your users instead what you should be using is canonical links on the desktop version, by doing so you are informing Google that the content originates from this page this will resolve any duplicate problems.

Responsive design is the way forward

Nowadays it's agreed by Google, web design and seo professionals that responsive is ideal for most websites. Responsive design will allow you to serve your website to multiple devices the way you want it too without having to create multiple urls. Because your only be using one url any backlinks and social mentions gained you are boosting mobiles, tablets and desktops, of course canonical links will help but ideally you should use responsive and canonical links too.

Picking a template based on a framework

If your using free templates then I recommend you look for frameworks based on or have your designer to make his own framework or use one of the common open source ones.


  • "canonical links on the desktop version" - just to clarify, is that canonical links to the desktop version? Or canonical links from the desktop version to the mobile site?
    – MrWhite
    Jul 21, 2014 at 18:14
  • Canonical links on the desktop version only. Jul 21, 2014 at 18:45

Are you able edit the code on the ?mobile=mobile indepently from the main page? If so rather than using just the canonical tags, maybe you should also be using the markup for mobile pages.

On the desktop page, add a special link rel="alternate" tag pointing to the corresponding mobile URL. This helps Googlebot discover the location of your site's mobile pages.

<link rel="alternate" media="only screen and (max-width: 640px)"
      href="http://www.example.com/current_page?mobile=mobile" >

On the mobile page, add a link rel="canonical" tag pointing to the corresponding desktop URL.

<link rel="canonical" href="http://www.example.com/current_page/" >

You can also defined the tags in a sitemap.xml file. More info here Building Smartphone-Optimized Websites


Create a subdomain example www.mobi.example.com and place the robots & duplicate web page files in the .mobi folder. Disallow robots to not index that sub domain folder.

Redirect them from www.example.com to www.mobi.example.com with JavaScript (you then know that they have a tablet or android device. you should look at using bootstrap for responsiveness however)

<script type="text/javascript">


if (screen.width <= 800) {
    window.location = "http://www.mobi.example.com";


Cookies are not always a good idea.

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.