DirectoryIndex index.php

#<IfModule mod_headers.c>
#	Header set Strict-Transport-Security "max-age=3600" env=HTTPS
#	Header set X-XSS-Protection "1; mode=block"
#	Header always append X-Frame-Options SAMEORIGIN
#	Header set X-Content-Type-Options nosniff
#</IfModule>

Header set Access-Control-Allow-Origin "*"

<IfModule mod_rewrite.c>

    SetEnv HTTP_MOD_REWRITE On
    # ab Apache 2.4 statt SetEnv HTTP_MOD_REWRITE On
    # RewriteRule .* - [E=HTTP_MOD_REWRITE:On]

    Options -MultiViews
    RewriteEngine on

    # für einige hoster wird eine RewriteBase benötigt
    # z.B. 1&1 Ionos, DomainFactory, united-domains
    #RewriteBase /

    ## https erzwingen
    #RewriteCond %{HTTPS} !=on
    #RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]

    ## www erzwingen
    #RewriteCond %{HTTP_HOST} !=""
    #RewriteCond %{HTTP_HOST} !^www\. [NC]
    #RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    ## www entfernen
    #RewriteCond %{HTTP_HOST} !=""
    #RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} !^.*\.(ico|jpe?g|png|gif|webp|swf|css|js|woff|woff2|eof|ttf)$ [NC]
    RewriteCond %{REQUEST_URI} !^/media/
    RewriteCond %{REQUEST_URI} !^/xtAdmin/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule .* index.php
</IfModule>

# jedes normale Hosting sollte gzip-Komprimierung aktiviert haben, falls doch nicht(?!), dann hier aktivieren und dann auf Fehler prüfen
# zum Aktivieren   ändern von mod_deflate.c_DEAKTIVIERT > mod_deflate.c
# zum Deaktivieren ändern von mod_deflate.c > mod_deflate.c_DEAKTIVIERT
<IfModule mod_deflate.c_DEAKTIVIERT>

    # Force compression for mangled `Accept-Encoding` request headers
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    # Compress all output labeled with one of the following media types.
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE "application/atom+xml" \
                                      "application/javascript" \
                                      "application/json" \
                                      "application/ld+json" \
                                      "application/manifest+json" \
                                      "application/rdf+xml" \
                                      "application/rss+xml" \
                                      "application/schema+json" \
                                      "application/geo+json" \
                                      "application/vnd.ms-fontobject" \
                                      "application/wasm" \
                                      "application/x-font-ttf" \
                                      "application/x-javascript" \
                                      "application/x-web-app-manifest+json" \
                                      "application/xhtml+xml" \
                                      "application/xml" \
                                      "font/eot" \
                                      "font/opentype" \
                                      "font/otf" \
                                      "image/bmp" \
                                      "image/svg+xml" \
                                      "image/vnd.microsoft.icon" \
                                      "text/cache-manifest" \
                                      "text/calendar" \
                                      "text/css" \
                                      "text/html" \
                                      "text/javascript" \
                                      "text/plain" \
                                      "text/markdown" \
                                      "text/vcard" \
                                      "text/vnd.rim.location.xloc" \
                                      "text/vtt" \
                                      "text/x-component" \
                                      "text/x-cross-domain-policy" \
                                      "text/xml"

    </IfModule>

    # Map the following filename extensions to the specified
    # encoding type in order to make Apache serve the file types
    # with the appropriate `Content-Encoding` response header
    # (do note that this will NOT make Apache compress them!).
    <IfModule mod_mime.c>
        AddEncoding gzip              svgz
    </IfModule>

</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 2692000 seconds"
    ExpiresByType image/x-icon "access plus 2692000 seconds"
    ExpiresByType image/jpeg "access plus 2692000 seconds"
    ExpiresByType image/png "access plus 2692000 seconds"
    ExpiresByType image/gif "access plus 2692000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2692000 seconds"
    ExpiresByType text/css "access plus 2692000 seconds"
    ExpiresByType text/javascript "access plus 2692000 seconds"
    ExpiresByType application/x-javascript "access plus 2692000 seconds"
</IfModule>
<IfModule mod_headers.c>
    <FilesMatch "\\.(ico|jpe?g|png|gif|webp|swf|css|js|woff|woff2|eof|ttf)$">
        Header set Cache-Control "max-age=2692000, public"
    </FilesMatch>
    Header unset ETag
    Header unset Last-Modified
</IfModule>
