Landing page does an automatic redirect

From Market Ruler Help
Jump to: navigation, search
  • You are using a shopping cart which automatically redirects upon landing on your home page.
  • Your home page contains some JavaScript which delivers content based on the screen size, platform, or ability to display flash
  • A Search Engine continues to send traffic to an old or legacy site and you want to redirect people immediately to a new site design


You will need to set up the automatic redirection to do a few things:

  1. Automatically preserve the query string parameters
  2. Append the &same=1 parameter to your URLs

If this is done automatically by your server software (e.g. Microsoft IIS or Apache), then you will need to contact your hosting provider and ask them if they can configure your server to preserve the query string upon redirection. Contact support if you would like our assistance in speaking with your support provider.

However, it is common that this is performed in JavaScript.

To modify the JavaScript such that it behaves correctly, you will need to append where the page is redirected to include whatever parameters were passed in.

You will see in your script something which most likely looks like this:

<script language="JavaScript">
    // Some code here
    document.location = '/cgi-bin/cart.cgi';

You can modify this to include the current page's query string parameters, like so:

<script language="JavaScript">
    var s =;
    if (!s) { 
        s = "?"; 
    } else if (s.substr(0,1) != '?') { 
        s = "?" + s; 
    document.location = '/cgi-bin/cart.cgi' + s + '&same=1&crxref=' + escape(document.referrer);

This will perform 3 things:

  • The same parameter tells ConversionRuler to ignore the fact that this landing is from the same domain name
  • The which is added to the page redirect passes the existing query string parameters to your landing page
  • The crxref parameter preserves the page referrer

If you have any further questions, contact us.