Du bist nicht angemeldet. Der Zugriff auf einige Boards wurde daher deaktiviert.

#1 26. Juni 2019 22:02

Janl
Server-Pate
Ort: Freistadt, Österreich
Registriert: 13. Dezember 2010
Beiträge: 1.231
Webseite

htaccess versemmelt Layout

Hallo,

habe gerade eine komische Erfahrung.

Wenn ich ein Bild (jpg) skaliere dann geht alles perfekt, bis ich mein "tuning" htaccess lade, dann wird ein Teil der CSS nicht angenommen.

[== html ==]
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.irgendwas\.de$
RewriteRule ^(.*)$ http://irgenwas.de/$1 [L,R=301]
RewriteCond %{SERVER_PORT} !443
RewriteRule .* https://irgendwas\.de/$1 [R=301,L]

<ifmodule mod_rewrite.c="">
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>

# Enable GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>

# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType image/gif "access plus 2678400 seconds"
  ExpiresByType image/jpeg "access plus 2678400 seconds"
  ExpiresByType image/png "access plus 2678400 seconds"
  ExpiresByType text/css "access plus 518400 seconds"
  ExpiresByType text/javascript "access plus 2678400 seconds"
  ExpiresByType application/x-javascript "access plus 2678400 seconds"
</ifmodule>

# Cache Headers
<ifmodule mod_headers.c>
  # Cache specified files for 31 days
  <filesmatch "\.(ico|flv|jpeg|jpg|png|gif|css|swf)$">
  Header set Cache-Control "max-age=2678400, public"
  </filesmatch>
  # Don't cache HTML
  <filesmatch "\.(html|htm)$">
  Header set Cache-Control "max-age=0, private, must-revalidate"
  </filesmatch>
  # Cache PDFs for a day
  <filesmatch "\.(pdf)$">
  Header set Cache-Control "max-age=86400, public"
  </filesmatch>
  # Cache Javascripts for 31 days
  <filesmatch "\.(js)$">
  Header set Cache-Control "max-age=2678400, private"
  </filesmatch>
</ifmodule>

<IfModule mod_headers.c>
  Header set X-Content-Type-Options nosniff
  Header set X-XSS-Protection "1; mode=block"
  Header set Content-Security-Policy "default-src 'self'"
  </IfModule>

ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
ErrorDocument 501 /501.html
ErrorDocument 502 /502.html
ErrorDocument 503 /503.html

Wenn ich alles lösche außer die erste 6 Zeilen dann funktioniert alles.

Was blockiert der CSS für Bilder?

Jemand eine Idee?

MfG
Jan


Kubuntu 22.04 - Win 11 pro / Kubuntu 20.04  - win10 pro

Offline

#2 15. November 2019 22:07

NaN
Moderator
Ort: Halle (Saale)
Registriert: 09. November 2010
Beiträge: 4.437

Re: htaccess versemmelt Layout

Bissel spät meine Antwort, aber besser spät als nie wink

Bin mir nicht sicher, aber ich glaube das liegt an GZIP.
Damit hatte ich bislang nie gute Erfahrungen gemacht.


Module: GBFilePicker, AdvancedContent
Sicherheit: Beispiel .htaccess-Datei
CMSms 1.12 unter PHP 7:
cmsms-1.12.3.zip (inoffiziell - komplett inkl. Installer)
CMSms 1.12 unter PHP 8:
cmsms-1.12.4.zip (inoffiziell - komplett inkl. Installer)

Offline

#3 16. November 2019 23:18

Janl
Server-Pate
Ort: Freistadt, Österreich
Registriert: 13. Dezember 2010
Beiträge: 1.231
Webseite

Re: htaccess versemmelt Layout

Danke NaN,

das könnte sein. Ich muss mich mal wieder an einer passenden htaccess setzen, nutze schon lange immer dasselbe. Google hat sicher wieder neue Forderungen . .  .

MfG
Jan


Kubuntu 22.04 - Win 11 pro / Kubuntu 20.04  - win10 pro

Offline