2

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
</Files>

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

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

What gives?

4
  • 2
    Any reason why your sqlite file has to be placed inside your web root? Apr 1, 2012 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, 2012 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. Apr 1, 2012 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, 2012 at 3:08

1 Answer 1

1

Send it a 404!

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*).db [NC]
RewriteRule ^(.*)$ 404.html [R=404,L]
1
  • or 301 to root page
    – b1_
    Jan 17, 2013 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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