On badly configured Apaches (like on errr… my host :), URLs referecing directories and lacking a trailing slash (like /mydir instead of /mydir/) lead to an error : the webserver looks for a file named mydir instead of a directory.
After some googling and lots of testing, I've come up with a solution. This should even work on Apaches with virtual hosts enabled and bad ServerName directive.
Put this in .htaccess in your document root (given example is for my site of course, replace the server name with yours)
- RewriteEngine on
- RewriteBase /
- RewriteCond %{REQUEST_FILENAME} -d
- RewriteRule ^(.+[^/])$ http://frenchfragfactory.net/$1/ [R=301,L]
Of course, you need mod_rewrite and the ability to override these settings in your .htaccess file.


