Thema: htaccess
Einzelnen Beitrag anzeigen
  #2 (permalink)  
Alt 08.02.2022, 11:03
top top ist offline
Benutzer
neuer user
 
Registriert seit: 06.01.2021
Beiträge: 44
top wird schon bald berühmt werden
Standard

Hi,
meine (zusammenkopierte) .htaccass sieht aktuell folgendermaßen aus:

Code:
# HTTPS erzwingen und www. ergaenzen/entfernen
RewriteEngine On

# Umleitung auf www. und HTTPS erzwingen
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]

# Entferne www. und erzwinge HTTPS 
# RewriteCond %{HTTPS} off [OR]
# RewriteCond %{HTTP_HOST} ^www\. [NC]
# RewriteRule ^(.*)$ https://example.com%{REQUEST_URI} [R=301,L]

# Gzip
<IfModule mod_mime.c>
	AddType text/javascript                js
	AddType application/vnd.ms-fontobject  eot
	AddType font/ttf                       ttf
	AddType font/otf                       otf
	AddType font/woff                      woff
	AddType font/woff2                     woff2
	AddType image/webp                     webp
	AddType image/svg+xml                  svg 
	AddType image/svg+xml                  svgz
	AddEncoding gzip                       svgz
</Ifmodule>

# Ablaufzeiten festlegen
<IfModule mod_expires.c>
	ExpiresActive on
	ExpiresDefault "access plus 5 minutes"
	ExpiresByType image/ico "access plus 1 year"
	ExpiresByType image/jpg "access plus 4 month"
	ExpiresByType image/jpeg "access plus 4 month"
	ExpiresByType image/gif "access plus 4 month"
	ExpiresByType image/png "access plus 4 month"
	ExpiresByType image/webp "access plus 4 month"
	ExpiresByType application/vnd.ms-fontobject "access plus 4 month"
	ExpiresByType font/ttf "access plus 4 month"
	ExpiresByType font/otf "access plus 4 month"
	ExpiresByType font/woff "access plus 4 month"
	ExpiresByType font/woff2 "access plus 4 month"
	ExpiresByType image/svg+xml "access plus 4 month"
	ExpiresByType application/x-shockwave-flash "access plus 4 month"
	ExpiresByType text/html "access plus 4 hours"
	ExpiresByType text/htm "access plus 4 hours"
	ExpiresByType text/javascript "access plus 32 days"
	ExpiresByType text/css "access plus 32 days"
	ExpiresByType text/xml "access plus 7 days"
	ExpiresByType application/xml "access plus 0 seconds"
	ExpiresByType application/json "access plus 0 seconds"
	ExpiresByType text/cache-manifest "access plus 0 seconds"
	ExpiresByType video/ogg "access plus 4 month"
	ExpiresByType audio/ogg "access plus 4 month"
	ExpiresByType video/mp4 "access plus 4 month"
	ExpiresByType video/webm "access plus 4 month"
	ExpiresByType video/m4v "access plus 4 month"
	ExpiresByType video/ogv "access plus 4 month"
</IfModule>


# Komprimierung aktivieren
<IfModule mod_headers.c>
	AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript
	AddOutputFilterByType DEFLATE application/xml
	AddOutputFilterByType DEFLATE application/rss+xml
	AddOutputFilterByType DEFLATE application/javascript application/x-javascript
	AddOutputFilterByType DEFLATE image/svg+xml

  # Ausnahmen
	BrowserMatch ^Mozilla/4\.0[678] no-gzip
	BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html
</IfModule>
Im Laufe der Jahre kamen da immer mal wieder Dinge dazu oder wurden angepasst. (Z.B. reichten Pagespeed früher kürzere Ablaufzeiten.) Eigentlich müsste ich da mal ausmisten. Ich denke z. B. "Shockwafe Flash" werde ich nicht mehr brauchen.
Mit Zitat antworten
Sponsored Links