I have http://example.com
and a PHP routing class that checks if some URL exists.
I want to make a new route, which is:
http://example.com/
You can handle the URI with php:
.htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
php:
if (isset($_SERVER['REQUEST_URI']))
{
$params = explode("/", ltrim($_SERVER['REQUEST_URI'], "/"));
print_r($params);
}
example.com/just/these/params
Output:
Array
(
[0] => just
[1] => these
[2] => params
)