I am trying to convert urls like this http://example.com/page.php?user=x&post=x
into
http://example.com/blogs/user/post
This is the code I have so far, not sure if I'm missing something or have done something wrong as it haven't been successful so far.
RewriteEngine On
RewriteRule ^blogs/([a-z0-9\-]+)/([0-9]{1,11})/$ page.php?user=$1&post=$2 [L]
EDIT: After making some amendments, it returns now an error 404 error saying page.php
is not found. I know for certain the file is there.
2ND EDIT: Resolved 404 issue.
The post
parameter is optional as well.user
can will have a mix of A-z0-9 (no character limit)post
can only be 0-9 with and upto 11 characters in length