Can someone help me with User friendly URL and get variables.
My file is called test.php and i'm using htaccess to remove the .php part of the url. In theory i want the following url construction in the following format: www.example.com/test/1234
where 1234 is my id= part
Whats the best way and how can i do this?
here's my htaccess so far:
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [L, QSA]
RewriteRule ^(.*)$ test.php?/$1 [L]
i'm trying to get the get variable by:
$var = $_GET['id'];
echo $var;
any help would be greatly appreciated. In future i will be using this to pass products name and using them as get variables to increase seo and the user experience. If you need any more information or any questions im happy to respond