3 # This is a simple example of an Apache VirtualHost configuration
4 # file that could be used with BookStack.
5 # This assumes mod_php has been installed and is loaded.
7 # Change the "docs.example.com" usage in the "ServerName" directive
8 # to be your web domain for BookStack.
10 # Change the "/var/www/bookstack/public/", used twice below, to the
11 # location of the "public" folder within your BookStack installation.
13 # This configuration is only for HTTP, Not HTTPS.
14 # For HTTPS we recommend using https://certbot.eff.org/
16 ServerName docs.example.com
17 DocumentRoot /var/www/bookstack/public/
19 <Directory /var/www/bookstack/public/>
20 Options Indexes FollowSymLinks
23 <IfModule mod_rewrite.c>
24 <IfModule mod_negotiation.c>
25 Options -MultiViews -Indexes
30 # Handle Authorization Header
31 RewriteCond %{HTTP:Authorization} .
32 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
34 # Redirect Trailing Slashes If Not A Folder...
35 RewriteCond %{REQUEST_FILENAME} !-d
36 RewriteCond %{REQUEST_URI} (.+)/$
37 RewriteRule ^ %1 [L,R=301]
39 # Handle Front Controller...
40 RewriteCond %{REQUEST_FILENAME} !-d
41 RewriteCond %{REQUEST_FILENAME} !-f
42 RewriteRule ^ index.php [L]
46 ErrorLog ${APACHE_LOG_DIR}/error.log
47 CustomLog ${APACHE_LOG_DIR}/access.log combined