Ergebnis 1 bis 2 von 2

Thema: Apache 2.4 - Anpassungen in htaccess erforderlich!

  1. #1
    Contao-Fan Avatar von tinoo
    Registriert seit
    19.06.2009.
    Ort
    made in switzerland
    Beiträge
    591

    Standard Apache 2.4 - Anpassungen in htaccess erforderlich!

    Hallihallo

    Vielleicht ist das ja bekannt resp. in neueren Contao-Versionen bereits berücksichtigt:

    Mein Hoster hat Apache auf Version 2.4 geupdatet, das hatte zur Folge dass die .htaccess
    wie folgt angepasst werden musste
    <IfModule filter_module>
    FilterDeclare COMPRESS
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/html'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/css'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/plain'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/x-component'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/javascript'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/json'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xhtml+xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/rss+xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/atom+xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/vnd.ms-fontobject'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/svg+xml'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/x-icon'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/x-font-ttf'"
    FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'font/opentype'"
    FilterChain COMPRESS
    FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
    </IfModule>
    Freundliche Grüsse
    Martin

  2. #2
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    34.120
    Partner-ID
    10107

    Standard

    Für die automatische Kompression sind folgende Zeilen in der .htaccess.default von Contao 3 verantwortlich:
    Code:
    ##
    # Set the proper MIME types
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_mime.c>
      AddType application/javascript              js jsonp
      AddType application/json                    json
      AddType audio/ogg                           oga ogg
      AddType audio/mp4                           m4a f4a f4b
      AddType video/ogg                           ogv
      AddType video/mp4                           mp4 m4v f4v f4p
      AddType video/webm                          webm
      AddType video/x-flv                         flv
      AddType image/svg+xml                       svg svgz
      AddEncoding gzip                            svgz
      AddType application/vnd.ms-fontobject       eot
      AddType application/x-font-ttf              ttf ttc
      AddType font/opentype                       otf
      AddType application/x-font-woff             woff woff2
      AddType image/x-icon                        ico
      AddType image/webp                          webp
      AddType text/cache-manifest                 appcache manifest
      AddType text/x-component                    htc
      AddType application/xml                     rss atom xml rdf
      AddType application/x-web-app-manifest+json webapp
      AddType text/x-vcard                        vcf
      AddType application/x-shockwave-flash       swf
    </IfModule>
    
    ##
    # Gzip compression
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_deflate.c>
      <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
        AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
        AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
      </IfModule>
    </IfModule>
    Wobei die MIME type Definitionen nicht unbedingt erforderlich sind (kommt auf den Server an). Auf manchen Servern (wie zB. bei den billigen Webhost Paketen von Hetzner) gibt es allerdings kein mod_filter.

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •