Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/04/2014, 05:53
fr1974
 
Fecha de Ingreso: noviembre-2007
Mensajes: 498
Antigüedad: 16 años, 5 meses
Puntos: 20
PHP mod_rewrite rule no me funciona

Hola a todos tengo varios problemas al aplicar el mod_rewrite con una serie de enlaces , aqui dejo lo qeu uso :


EN EL HTACCESS

RewriteEngine on
RewriteRule ^noticia/([^/]+).html noticias.php?id=$1 [NC,L]


CÓDIGO ARCHIVO NOTICIAS.PHP

<?php
echo $_GET[id];
?>

<a href="noticias/seguridad.html">Noticia 1</a>
<br />
<a href="noticias/seguridad2.html">Noticia 2</a>


Uno de los problemas es que al darle a un enlace no consigo obtener el valor del id y otro problema es que al darle a un enlace si va a seguridad.html , etc pero al darle a otro enlace y luego a otro la URL se empieza a volver más grande y se agrega a la principal , por ejemplo si la URL debería de ser siempre noticias/seguridad.html al darle a un enlace empieza a poner noticias/noticias/seguridad.html y a la siguiente pone noticias/noticias/noticias/seguridad.html , no entiendo por qé sucede esto


Bueno a ver que me comentan un saludo a todos y muchas gracias