I'm trying to add a missing trailing backslash to avoid a rewrite.
That is, when when a url like http://example.com/dir is entered with no trailing slash, the server responds with a tiny HTML redirect page that says Moved Permanently to an address with the trailing slash. But the user never sees it because the browser immediately sends a new request for the new page.
But for a few non-browser services, the redirect is inconvenient. I would like the server to immediately send the right thing with no redirect.
I put this in my .htaccess file, but it did not change the behaviour at all. Note that I have the rewrite engine turned on and other rewrite rules that do work.
RewriteRule ^/dir$ /dir/ [L]
I'm wondering if the server has a rewrite rule in the configuration file that gets executed before it even reads my .htaccess file.
Is there any way to get an immediate correct response with no rediret?