I have my site as localhost/tutorials/rewrite/news.php
on this page are titles from news articles that are in my database. Each title is a link to read the article. The link is
'<a href="read-news.php?url=' . $url . '">' . $title1. '</a>'
The read-news.php page gets the url and uses it in an sql statement to get the article from the database
$url = $_GET['url'];
$sql = "SELECT * FROM news WHERE url = '$url'";
My link on the news.php page and the url on the read-news.php looks like this
localhost/tutorials/rewrite/read-news.php?url=the-news-today
How can i get it to look like
localhost/tutorials/rewrite/read-news/the-news-today.php
I have used the following htaccess code which by looking at other examples i thought should be enough to fix it
RewriteRule ^read-news/(.*).php /read-news.php?url=$1 [PT]
Any help please