بأمكانك اضافته كاول سطر بلصفحة بلطريقة هاي
كود PHP:
<?php
if(preg_match("/[index.php]$/",$_SERVER[REQUEST_URI]))
{
$url="http://".$_SERVER[HTTP_HOST].preg_replace("/(index.php)$/","",$_SERVER[REQUEST_URI]);
$sapi=php_sapi_name();
if (PHP_VERSION >= '4.3.0')
{
header("Location: $url", 0, 301);
}
else if ($sapi == 'cgi' OR $sapi == 'cgi-fcgi')
{
header("Location: $url");
// Call the status header after Location so we are sure to wipe out the 302 header sent by PHP
header('Status: 301 Moved Permanently');
}
else
{
header("Location: $url");
header('HTTP/1.1 301 Moved Permanently');
}
}
?>