I am trying to pass variables through the url without including ?var1=test but have that replaced with /test. I have the following code:
$pathinfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : $_SERVER['REDIRECT_URL'];
$params = preg_split('|/|', $pathinfo, -1, PREG_SPLIT_NO_EMPTY);
print_r($params);
This issue is, if I put this in the index.php file, I have to include the filename.
What I get: http://example.com/index.php/test
What I want: http://example.com/test
What should I do?