I am trying to rewrite the URL of my website for PHP page I have different conditions
first example.com/view.php?id=1
Here I need to hide id from the URL I need it like this
example.com/view/1
second, for some page, I have different variable like this example
example.com/view/book.php?id=1&user=33333&booked=1
I need to rewrite link to this example
example.com/view/book/1/33333/1
here is what I did in .htaccess page
# Remove .php file extension on requests
RewriteRule ^(.+).php$ /$1 [R,L]
RewriteRule ^(view/booked)/([0-9]*)$ $1.php?id=$2 [END]
# Append .php extension for other requests
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*?)/?$ /$1.php [END]
RewriteRule ^(view/book)/([0-9]*)/([0-9]*)/([0-9]*)$ $1.php?id=$2&user=$3&booked=$4 [END]
for example 1 it works well example.com/view/1 without any problem and for example.com/view/booked/1 as well.
The only problem with the second example example.com/view/book.php?id=1&user=33333&booked=1 I need to hide variables