Mod rewrite novice here. I want to pass two URL parameters in the URL, but in a more friendlier format. If user passes, "example.com/blah123/sys", I should be able to extract the MySQL record "blah123" and the mode type "sys", in this case. Here's the example:
URL:
example.com/blah123/sys
In the .htaccess, I have:
RewriteEngine On
RewriteRule ^([^/.]+)/?$ index.php?id=$1
The above works if the URL passed is: "example.com/blah123", but not "example.com/blah123/sys".
I tried the following, but it is not working:
RewriteEngine On
RewriteRule ^([^/.]+)/?$/?$ index.php?id=$1?mode=$1
I need to extract the "mode" type passed in the second argument. So, if the user enters "example.com/blah123/sys", I should be able to get the value "sys" from the URL. How can I do that? I want to use PHP, MySql, .htacess.
UPDATE: My current .htaccess:
# Use PHP 5.3
AddType application/x-httpd-php53 .php
RewriteEngine On
#RewriteRule ^([^/.]+)/?$ index.php?id=$1
RewriteRule ^([^/.]+)/([^/.]+)/?$ index.php?id=$1&mode=$2 [L,QSA]