asi mas o menos lo haria yo.
index.php
Código PHP:
<?php
$caracteresespeciales = array(" ", "/", "*", "!", "$", "%", "&", "/", "(", ")", "=", "?", "¿", "'", "á", "é", "í", "ó", "ú", "ñ", "Ñ","©","@","®");
//Hago la consulta
$sop = "SELECT * FROM noticias";
//Guardo el resultado
$result = mysql_query($sop);
while($rnews=mysql_fetch_array($result)) {
$title = $rnews["titulo_noticia"];
$namenews = str_replace($caracteresespeciales,"_",$title);
?>
<?php echo $title;?><br>
<a href="noticia-<?php echo $namenews; ?>-<?php echo $rnews["idnoticia"]; ?>.html" title="<?php echo $title; ?>">Ver noticia Completa</a>
<?php
}
?>
noticia.php
Código PHP:
<?
include("dinamic/conex_as.php");
$idnoticia = $_GET["idnoticia"];
$conexion=mysql_connect($host,$usuario_db,$pass_usuario_db);
$seldb=mysql_select_db($basedatos);
//Hago la consulta
$sop = "SELECT * FROM noticias WHERE idnoticia=$idnoticia";
//Guardo el resultado
$result = mysql_query($sop);
while ($lista = mysql_fetch_array($result)){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$lista["titulo"];?></title>
</head>
<body>
<?=$lista["titulo"];?>
</body>
</html>
<?
}
mysql_close($conexion);
?>
mod_rewrite .htaccess:
Código:
# .htaccess file
Options FollowSymLinks
#activacion del motor de escritura
RewriteEngine On
#aca van las reglas de reescritura
RewriteRule ^noticia-(.*)-(.*).html$ noticia.php?idnoticia=$2