I need to create a clean url what i have is
localhost/tutorials/rewrite/read-news.php?url=the-news-today
and i want it to read
localhost/tutorials/rewrite/read-news/the-news-today
The page is called read-page.php and the content is generated from the database
The news.php contains the links to each news article and my link is wrote like this
<a href=“read-news.php?url=’ . $url . '”>’ . $title1. '</a>
and it is shown like this
localhost/tutorials/rewrite/read-news.php?url=the-news-today
My code to get the article is
$url = $_GET[‘url’];
$sql = “SELECT * FROM news WHERE url = ‘$url’”;
From looking at example I thought something like this in the htaccess would sort the problem, but it does not
RewriteRule ^read-news/(.*).php read-news.php?url=$1 [L]