topical media & game development
professional-search-08-seophp-include-url-redirect.inc.php / php
<?php
// load the URL factory library
require_once 'url_factory.inc.php';
// redirect requests to index.php and index.html to the root
function fix_index_url()
{
// if the request is for index.php we redirect to ./
if (preg_match('#(.*)index\.(html|php)_SERVER['REQUEST_URI'], captures[1]);
}
}
// redirects to proper URL if not already there
function fix_category_product_url()
{
// obtain the proper URL of the current category/product page
_SERVER['REQUEST_URI'] != proper_url);
exit();
}
}
// returns the proper keyword-rich URL
function get_proper_category_product_url()
{
// retrieve product and category IDs from the query string
_GET['product_id'];
_GET['category_id'];
// retrieve product and category names from fictional database
GLOBALS['products'][category_name = category_id];
// create keyword-rich URL
category_name, product_name, proper_url;
}
?>
(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.