# Блокировать атакующих
#Deny from 192.168.0.1
#Deny from 192.168.0.2

Options -Indexes

DirectoryIndex index.html .cms/index.php

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase "/"

    # domain.ru, www.domain.ru => domain.com
    #RewriteCond %{HTTP_HOST} ^(www\.)?domain\.ru$ [NC]
    #RewriteRule ^(.*)$ https://domain.com%{REQUEST_URI} [R=301,L]

    # http => 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]

    # redirect /test/ to /test if file /test is exist
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_URI} ^(.+)/$
    RewriteRule ^(.+)/$ $1 [R=301,L]

    #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>
