I want to rewrite post.php?id=1&title=test to post/1/test
I have this code:
RewriteRule ^post/([^/]+)/([^/]+)/?$ post.php?id=$1&title=$2 [L,QSA]
This only works if I rename post.php links to /post in my php file. I want to rewrite the urls so that I don't need to edit any links.
Similar to below:
RewriteCond %{THE_REQUEST} \s/+(post)\.php[?/\s] [NC]
RewriteRule ^ %1 [R=301,L]
RewriteRule ^(post)/?$ $1.php [L]