Okay, so, I ditched trying to rewrite shit in Apache for now. I tried using a much simpler PHP version.

CODE
<?php
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.