My semi-helpful answer is that this code looks right, and when I ran it, it behaved as expected. So there must be something else going on that we can’t see here from your snippet of code. Are there other rewrite rules? Other htaccess files?
There are no other rules in the script. That’s the whole thing.
There’s another .htaccess file in a subdirectory, but its irrelevant. Here it is just in case:
RewriteEngine on
RewriteRule ^uploads/(.*)$ ?filename=$1 [L]
There are no .htaccess files in any parent folders.
The server’s running Ubuntu 13.10, there’s a conf file in /etc/apache2/apache2.conf, but I can’t see anything in there.
These are the vhost settings:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>