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?

  • 2
    Any reason why your sqlite file has to be placed inside your web root? – Lèse majesté Apr 1 '12 at 21:00
  • 1
    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
  • 1
    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]
| improve this answer | |
  • or 301 to root page – b1_ Jan 17 '13 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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