Results 21 to 25 of 25

Threaded View

  1. #1
    Join Date
    Jan 2008
    Posts
    43
    Plugin Contributions
    0

    Default Eliminating dual content due to missing cPath variable

    Good day,

    Some time ago I read about search engines seeing links with and without cPath as different links, seeing this as dual content, this being a bad thing.

    I don't know if that has been solved or not, but since I couldn't find anything about it and it was possible on my install I looked for a solution.

    I adjusted a piece of code someone else on this board put together for me (originally so I could redirect old incoming quick-cart links to the new zen-cart links).

    This code checks if a product_info link has a cPath, and if it doesn't it looks it up and redirects with a 301 moved permanently header.

    So far it seems to work, if anyone spots any problems with this system I'd love to hear about it.

    Code:
    if ($_GET['main_page'] == 'product_info' && !(isset($_GET['cPath'])) && isset($_GET['products_id']) && (int)$_GET['products_id'] > 0) {
      $iProducts_id = (int)$_GET['products_id'];
      Header( "HTTP/1.1 301 Moved Permanently" );
      zen_redirect(zen_href_link(zen_get_info_page($iProducts_id), 'cPath=' . zen_get_product_path($iProducts_id).'&products_id='.$iProducts_id));
    }
    There's probably tons of places to put this and it'll work, I just put it in index.php below:
    Code:
    /**
     * Load common library stuff 
     */
      require('includes/application_top.php');"
    Last edited by Diavire; 12 Jul 2008 at 12:25 PM.

 

 

Similar Threads

  1. v151 Need help w/ variable flat rate shipping due to item size
    By ogre in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Oct 2013, 09:34 PM
  2. v150 COWOA forgot password fails due to missing function
    By geeker in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 2 Nov 2012, 06:01 AM
  3. Replies: 2
    Last Post: 20 Nov 2008, 07:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg