== An Apache trick: using directories to create redirections Suppose, not entirely hypothetically, that you're using Apache ProxyPass directives as a reverse proxy to map _/someurl/_ on your website to another web server. [[You generally have to redirect the URL with the trailing slash ApacheProxyPass]], but of course you would like a request for a plain '_/someurl_' to also work right instead of just getting a 404 status response. Here, 'work right' means that you'll generate a redirection from '_/someurl_' to '_/someurl/_'. It's certainly possible to do this with one of the various Apache directives for explicit redirections (I'd use _RedirectMatch_). But often there's an easier way: use a real filesystem directory. If _somedir_ is a directory in the Apache document root and you send a request for '_/somedir_', Apache's default behavior is to send exactly the redirection we want. And Apache doesn't care if the '_/somedir/_' URL is being diverted somewhere other than the filesystem (via ProxyPass or other directives); it will still send that redirection regardless. So we can just do '_mkdir /docroot/someurl_' and everything will work. The directory contents don't matter; I tend to put a README file there with a note about how the directory is just there for the redirection and actual contents in it will be ignored. (This redirection trick happens automatically if you're using _.htaccess_ files in a directory to control, say, [[internal redirections ApacheRedirectHtaccess]]. However there are various reasons for not using _.htaccess_ files, including centralizing your configuration in one easily visible place instead of spraying it all over the filesystem in a bunch of nominally invisible files.) Back when I wrote [[my entry on ProxyPass ApacheProxyPass]], I theorized about using this trick. I can now say that we've actually done this in our configuration and it works fine. (This trick is a very old one, of course; I'm sure people have been doing it in Apache for ages. I just feel like writing it down explicitly for various reasons.)