Setting up Apache2 for Coffee CMS

Below are the contents of the .htaccess file included with Coffee CMS. On many hosting sites, the settings contained in it are taken into account automatically. If this does not happen, contact the hoster and inform them that you need to configure the server in accordance with the settings specified in the .htaccess file.

Options -Indexes

DirectoryIndex index.html /.cms/index.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    # http to https
    #RewriteCond %{HTTPS} off
    #RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # . -> www
    #RewriteCond %{HTTP_HOST} !^www\. [NC]
    #RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    # www -> .
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

    # .hidden files
    RewriteCond %{THE_REQUEST} "^(GET|POST|HEAD) (^|/)\.(.*) HTTP/[0-9.]+$"
    RewriteRule ^ - [F]

    #AcceptPathInfo Off
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*)$ /.cms/index.php
</IfModule>

#<IfModule mod_expires.c>
#    ExpiresActive On
#    ExpiresDefault "access plus 1 week"
#</IfModule>
#
#<IfModule mod_deflate.c>
#    SetOutputFilter DEFLATE
#</IfModule>