Bien, comienza de la siguiente forma:
Tengo mi index en el cual se muestra el listado de noticias extraído de una base de datos:
Código PHP:
<?php
require_once 'Public/Libraries/ez_sql_core.php';
require_once 'Public/Libraries/ez_sql_mysql.php';
//Conexión a la base de datos
$conn = new ezSQL_mysql('root', '', 'foro', 'localhost');
//Selección de la base de datos
$noticias = $conn->get_results('SELECT * FROM news ORDER BY news.id_new DESC');
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>TecPokémon</title>
<link href="Public/CSS/TecPokemon.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Cabin+Condensed:700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="container">
<?php include ('Includes/Cabecera.php'); ?>
<?php include ('Includes/Menu.php'); ?>
<div class="content">
<?php foreach ($noticias as $noticia) { ?>
<div class="News">
<div class="News-Info"><p>Publicado por <?php echo utf8_encode($noticia->author); ?> el <?php echo $noticia->date; ?></p></div>
<h1><a href="new.php?id=<?php echo $noticia->id_new; ?>"><?php echo utf8_encode($noticia->title); ?></a></h1>
<p><?php echo utf8_encode($noticia->content); ?></p>
</div>
<?php } ?>
</div>
<div class="sidebar2">
<?php include ('Includes/Sesion.php'); ?>
</div>
<?php include ('Includes/Pie.php'); ?>
</div>
</body>
</html>
Código PHP:
<?php
require_once 'Public/Libraries/ez_sql_core.php';
require_once 'Public/Libraries/ez_sql_mysql.php';
//Conexión a la base de datos.
$conn = new ezSQL_mysql('root', '', 'foro', 'localhost');
//Resultado de base de datos.
$id = $_GET["id"];
$id = $conn->get_row("SELECT * FROM `news` WHERE `id_new` = {$id}");
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="description" content="<?php echo substr(strip_tags(utf8_encode($id->content)), 0, 130)."..."; ?>">
<meta name="keywords" content="">
<title><?php echo $id->title; ?></title>
<link href="Public/CSS/TecPokemon.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Cabin+Condensed:700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="container">
<?php include ('Includes/Cabecera.php'); ?>
<?php include ('Includes/Menu.php'); ?>
<div class="News-Content">
<div class="News-Info"><p>Publicado por <?php echo utf8_encode($id->author); ?> el <?php echo $id->date; ?></p></div>
<h1><?php echo utf8_encode($id->title); ?></h1>
<?php echo utf8_encode($id->content); ?>
</div>
<div class="sidebar2">
<?php include ('Includes/Sesion.php'); ?>
</div>
<?php include ('Includes/Pie.php'); ?>
</div>
</body>
</html>
Código Apache:
Ver original
RewriteEngine on RewriteRule ^(.*).html new.php?id=$1
Y en efecto, me reescribe la URL pero solamente cuando la escribo directamente en el navegador (http://miweb.com/1.html) y lo que quiero conseguir, es que al pasar el cursor por el enlace, me muestre "http://miweb.com/1.html" pero me muestra "http//miweb.com/new.php?id=1"...
Entonces ¿Qué puedo hacer para que se muestre en el enlace la URL?.
Acá una imagen gráfica de lo que digo:
![](http://i42.tinypic.com/2lb283c.png)
Disculpen tanta información pero quiero ser lo más concreto posible.
Saludos.