Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VPS, running apache2 on Debian 6.

Created a file called .htaccess on the web root, which included:

<Files ~ "\.db$">
    Order allow,deny
    Deny from all

<FilesMatch "\.db$">
Deny from all

Can still manually download the database.db file that exists in the same directory as the .htaccess file. Restarted Apache2, same.

What gives?

share|improve this question
Any reason why your sqlite file has to be placed inside your web root? – Lèse majesté Apr 1 '12 at 21:00
at this point no, but this is making me mad that I can't get htaccess to work how it should – ParoX Apr 1 '12 at 23:00
What's the AllowOverride setting for that directory? Also, for future reference, you don't need to restart Apache for .htaccess changes to take effect. – Lèse majesté Apr 1 '12 at 23:14
SQLLite database is for Android Applications. It has no relation with httaccess. httaccess file resides in the XAMPP/WAMP/LAMP folder you installed. You could be asking to download the SQL file. It can be done by clicking Export button in you phpMyAdmin page. If I am wrong then please state how you are facing problem. – NewUser Aug 20 '12 at 3:08

Send it a 404!

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*).db [NC]
RewriteRule ^(.*)$ 404.html [R=404,L]
share|improve this answer
or 301 to root page – nk9 Jan 17 '13 at 10:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.