Tag Archives: SQLite

Apache – prevent SQLite DB from download

If you are using SQLite for your website as backend database then it is important to prevent others from downloading the entire database, since SQLite is a file then it can be solved by denying access to the file from the web by this .htaccess rule

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*).db [NC]
RewriteRule ^(.*)$ 404.html [R=404,L]

The rule will prevent access to all files with .db in the name, that will prevent download of files like blog.db mydatabase.db etc.

In my example it will redirect to a 404.html page

Your php script is running inside the server and will still have access to your database files as long as it has the correct unix fileaccess

Adminer – MariaDB/MySQL/PostGreSQL/SQLite Database management in a single file

If you wan’t easy external access to a MariaDB/MySQL/PostGreSQL/SQLite and some other known databases that consist of a single php file that is easy to setup on any webserver with PHP then Adminer is a great and handy little solution to install.

Here is a small screenshot of the system, it allows the most basic SQL features as creating a database, handle table schema, insert, update, create an query a database.

Adminer is also faster and tidier than phpMyAdmin that would be the closest similar management system.

Read more and download Adminer here