Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/03/2010, 12:29
xamamo
 
Fecha de Ingreso: septiembre-2007
Mensajes: 106
Antigüedad: 16 años, 7 meses
Puntos: 1
Respuesta: urls amigables - es necesario php?

nada, no hay manera.

Ahora mismo, lo tengo así:

.htacces:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Rewriterule ^noticias/(.+)/(.+) noticia.php?id=$1&titulo=$2


.index.php donde llamo al noticia.php?id=loquesea:


<?php
function urls_amigables($url) {

// Tranformamos todo a minusculas

$url = strtolower($url);

//Rememplazamos caracteres especiales latinos

$find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');

$repl = array('a', 'e', 'i', 'o', 'u', 'n');

$url = str_replace ($find, $repl, $url);

// Añaadimos los guiones

$find = array(' ', '&', '\r\n', '\n', '+');
$url = str_replace ($find, '-', $url);

// Eliminamos y Reemplazamos demás caracteres especiales

$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');

$repl = array('', '-', '');

$url = preg_replace ($find, $repl, $url);

return $url;

}

while($fila = mysql_fetch_array($resListar)) { ?>

<?$url = $fila['titulo'];?>

<h5><?php echo "(".date('d/m/Y', getTimestamp($fila["fecha"])).")"; ?></h5>




<p><?php echo $fila['titulo']; ?> <a href="noticias/<?php echo $fila['id']?>/<?echo urls_amigables($url);?>/">(+)</a></p>


<?php } ?>


Y nada. el ejemplo es de http://www.baluart.net/articulo/urls-amigables-con-php que realmente tiene una pinta buenísima

Y realmente me genera: http://www.mipagina.com/noticias/159...et-crece-un-5/

Pero me da pagina not found!

Alguna solucion?

gracias