I want to change my url from localhost:9090/xyz/post.php?p=4&t=sometext to localhost:9090/xyz/4/sometext
This is what i've tried so far...
RewriteEngine OnRewriteBase /xyz/
# removing the php extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# Redirect the .php extension to the non .php extension
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
RewriteRule ^ /%1 [L,R=301,NE]
# SEO friendly url
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_URI} ^xyz.*
RewriteRule ^([0-9]+)/([a-z0-9\-_]+)$ post.php?p=$1&t=$2 [NC,L,R=301]
This is what i'm getting
Not Found The requested URL was not found on this server.
Any suggestions please?
Thanks!