topical media & game development

talk show tell print

professional-search-14-seophp-include-url-redirect.inc.php / php



  <?php
  // load the URL factory library
  require_once 'url_factory.inc.php';
  
  // redirects to proper category URL if not already there
  function fix_category_url(proper_url)
  {   
    // 301 redirect to the proper URL if necessary
    if (SITE_DOMAIN . _SERVER['REQUEST_URI'] != proper_url) 
    { 
      header('HTTP/1.1 301 Moved Permanently');
      header('Location: ' . proper_url);
      exit();     
    }
  }
  
  // redirects to proper product URL if not already there
  function fix_category_product_url(proper_url)
  {  
    // 301 redirect to the proper URL if necessary
    if (SITE_DOMAIN . _SERVER['REQUEST_URI'] != proper_url) 
    { 
      header('HTTP/1.1 301 Moved Permanently');
      header('Location: ' . proper_url);
      exit();     
    }
  }
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.