Original URL: https://www.example.com/all_users/user.php?id=1&subtype=p
Expected URL: https://www.example.com/user/john-doe.html
I tried using following rule, it redirects to expected URL but I can't use parameters (id and subtype) with new URL.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^id\=1&subtype\=p$
RewriteRule ^all_users/user\.php$ https://www.example.com/user/john-doe.html? [R=301,L]
How can I use parameter values with new URL.
Example:
After redirect, new URL will be https://www.example.com/user/john-doe.html Then I should able to get original parameters value with new URL.
$id = $_GET['id'];
$type = $_GET['subtype'];