CODE
<?php
if (substr($_SERVER['REQUEST_URI'], -1) == '/') {
$uri = rtrim($_SERVER['REQUEST_URI'], '/');
header('Location: ' . $uri);
}
?>
if (substr($_SERVER['REQUEST_URI'], -1) == '/') {
$uri = rtrim($_SERVER['REQUEST_URI'], '/');
header('Location: ' . $uri);
}
?>
Basically, it's just to remove the trailing slash of a directory (I know, kind of stupid/odd, but it's what the client wants). And it works just fine, sort of. I keep getting a message from the browser that the page isn't redirecting properly and that "it detected that the server is redirecting the request for this URL in a way that it will never complete."
So, any ideas on what could be the issue? Thanks.