- I have an website on my localserver (with Apace) and i want to rewrite urls.
I have .htaccess file.
I have RewriteEngine ON (on Apache)
index.php
<a href="post.php?post=<?php echo $row['postID'];?>"><h4><?php echo $row['postTitle']; ?></h4></a>
When someone press on the title of post will be redirected to post.php/post=postID
I want to rewrite this url (localhost/post.php/post=postID) to something like that:
/localhost/post/postTitle or /localhost/post/postID
Preferably the first one.
How can I do that?
.htaccess
RewriteEngine On
RewriteRule ^posts/([0-9]+)/?$ post.php?post=$1 [NC,L]
Nothing happens, when I press on the link, the url is the same (post.php/post=postID).