I'm trying to get the browser to redirect whenever the user types in /index.php or /index.php/ or /index.php//// to just plain / . Here's what I have so far
if ($_SERVER['ORIG_PATH_INFO'] == '/index.php') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://'.$_SERVER['HTTP_HOST'].'/'
}
But I get a infinite loop redirect error. What am I doing wrong? Is there any way to make this work?
EDIT, it seems that changing 'ORIG_PATH_INFO' to 'REQUEST_URI' did the trick for /index.php what do I add to my if to take care of index.php/ and index.php////...?