Ever since folders and pages were concieved, people have asked which is best. Do I want http://www.hungerfordwebdesign.com/ or http://www.hungerfordwebdesign.com/index.php ?
Well, the truth is that it doesn’t really matter. What matters most is that anyone linking to you is using the same link all of the time. Therefore search engines which crawl these sites will always index your site in the same way and thereby increase your presence.
There are a number of ways of achieving this, you can use your htaccess as follows:
RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP
RewriteRule (.*)index\.(php|html)$ /$1 [R=301,L]
Or you can do this in PHP:
<?php
// NOTE:no trailing /
$GLOBALS['site_base_url'] = ‘http://www.foo.com’;
function assertProperURL($proper_url)
{
global $site_base_url;
$request_uri = $_SERVER['REQUEST_URI'];
$current_url = $site_base_url . $request_uri;
if ($current_url != $proper_url) {
header(”HTTP/1.1 301 Moved Permanently”);
header(’Location: ‘ . $proper_url);
}
}
assertProperURL($GLOBALS['site_base_url'] . ‘/’, true);
?>
These examples centre on removing the index.php part of the URL, you can help yourself by ensuring that your /folder/ links are not /folder/page.php where possible. Internal link consistency is almost as important as the external links.











