Apache
Recommended Apache configuration.
Enable mod_rewrite and point the document root to public/.
VirtualHost #
<VirtualHost *:80>
ServerName velvetcms.com
DocumentRoot /var/www/velvetcms/public
<Directory /var/www/velvetcms/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/velvetcms.error.log
CustomLog ${APACHE_LOG_DIR}/velvetcms.access.log combined
</VirtualHost>
.htaccess #
The .htaccess file in public/ routes all requests to index.php:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>
Security headers (optional) #
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
</IfModule>