Here is my php code(qs.php). This file contain pretty url links.
<html>
<head></head>
<body>
<?php
$file = 'qs1'; //this is a php file qs1.php
$id = '12345678'; //testing ID
$complete_url = $file."/".$id;
?>
<a href ="<?php echo $complete_url;?>"> This is a test link </a>
</body></html>
This link appear link this - http://localhost/qs1/12345678
QS1 is a php file (qs1.php).
Below is the htaccess file so far.
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]+)/(\d+)/([^/]+)$ $qs1.php?var1=$2 [NC,L]
In qs1.php file i am getting query string var1 by $_GET['var1']
I want link can be accessible by this url http://localhost/qs1/12345678.
and if user put slash at the end like this http://localhost/qs1/12345678/ then page redirect itself to this http://localhost/qs1/12345678.
At the moment i am getting error 404 while opening this http://localhost/qs1/12345678/
Thanks for your comment.