How to configure separate page redirects

Google’s SEO recommendation for separate mobile sites is that specific page redirects are configured, so that if your smart phone visitor arrives on a specific (secondary) page of a desktop site, they are not redirected to the main page of the mobile site (as this creates a bad user experience) and instead are redirected to the corresponding page of the mobile site, or not redirected at all, if a corresponding page does not exist.

I am sure you’ve had that experience: you are on your smart phone trying to open a link to a page you saw on a “desktop” site (and perhaps saved in your email), and .. you are redirected to the home page of the mobile site. Annoying, and apparently also bad for SEO.

Our redirect script allows you to set up specific “per page” redirects for mobile sites, as well as the default redirect for all other pages. The default redirect could be a page on a mobile site, or no redirect at all.

Here is how you configure specific “per page” redirects:

1. In a mobile site’s dashboard, click on the Redirect Info link, then click on “How to configure separate per-page redirects”. You will see the script that looks something like:

 <script type="text/javascript">
    gMobileRedirectorTargetDefault = 'http://m.ClientWebsite.com/'
 </script>
 <script type="text/javascript" src="http://yourWhiteLabel.com/content/js/js-redirector.1.0.0.js"></script>

2. Add a section for gMobileRedirectorExceptions with the individual per page redirects in it:

<script type="text/javascript">
    gMobileRedirectorTargetDefault = 'http://m.ClientWebsite.com/';

   gMobileRedirectorExceptions = { 
   '/special': 'http://m.ClientSite.com/special/',
   '/about': 'http://m.ClientSite.com/about/',
   '/printcoupons/': null
};
</script> 
<script type="text/javascript" src="http://yourWhiteLabel.com/content/js/js-redirector.1.0.0.js"></script>

 

In the above example we’ve redirected the pages “/special” and “/about” to their equivalent pages on the mobile site, and configured the page “/printcoupons” to not redirect at all.

The desktop page URLs should be “relative” (should not include the domain of the desktop site).  Please make sure you separate the lines with a comma (“,”).

The default redirect (for pages that you have not listed in the “gMobileRedirectorExceptions” section) is set above that in gMobileRedirectorTargetDefault variable.  If you do not want the default redirect to be set to anything, then set it to null, as follows:

        gMobileRedirectorTargetDefault = null;

 

3. Next you need to copy and paste all that code in the < HEAD > section of all desktop site pages. If the desktop site is created using WordPress, see these instructions on adding the redirect code to a WordPress site.