Support » Allgemeine Fragen » Safari 11.1.x und Edge zeigen keine Bilder an

  • Gelöst stefansic

    (@stefansic)


    Hi Leute,

    vielleicht gibt es eine Lösung für mein Problem.
    Safari 11.1.x und Edge, aktuelle Version, zeigen keine Bilder an, wenn ich meine Seite aufrufe.
    Alle anderen Browser funktionieren problemlos:
    Safari ab 12.x, Firefox alle, Chrome alle, Samsung auf dem Handy, Firefox auf Handy….

    Vielleicht hatte ja mal jemand ein ähnliches Problem. Übrigens geht es auch nicht mit einem WP Standard-Theme, auf welches ich kurzfristig mal gewechselt bin.

    Ist das vielleicht ein generelles WP-Problem?

    Bin für jede Hilfe dankbar.

    LG Stefan

    Die Seite, für die ich Hilfe brauche: [Anmelden, um den Link zu sehen]

Ansicht von 8 Antworten - 16 bis 23 (von insgesamt 23)
  • Thread-Starter stefansic

    (@stefansic)

    Offensichtlich hatte ein Plugin, das ich getestet habe, die .htacces-Datei zugemüllt. Ich habe keine Erfahrung mit WP, deshalb habe ich daran einfach nicht gedacht. Hier mal die Datei, wie ich sie gestern verblüfft vorgefunden hatte.
    Danke für deine Hilfe, du hast mich drauf gebracht!

    # BEGIN self
    RewriteEngine On
    RewriteCond %{SERVER_PORT} !=443
    RewriteRule ^(.*)$ https://das-goldene-tor.de/$1 [R=301,L]
    # END self
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # ----------------------------------------------------------------------
    # | BLOCK NUISANCE REQUESTS - New in 2018  
    #   https://perishablepress.com/block-nuisance-requests
    # ----------------------------------------------------------------------
    
    # Comment it out, if you don't use Let's Encrypt, because Let's Encrypt ist using .well-known
    # Wenn Du Let's Encrypt nutzt, kannst Du das nicht verwenden, weil Let's Encrypt .well-known nutzt.
    <IfModule mod_alias.c>
    	RedirectMatch 403 (?i)\.php\.suspected
    	RedirectMatch 403 (?i)\.(git|well-known)
    	RedirectMatch 403 (?i)apple-app-site-association
    	RedirectMatch 403 (?i)/autodiscover/autodiscover.xml
    </IfModule>
    
    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresDefault                                      "access plus 1 month"
    
      # CSS
        ExpiresByType text/css                              "access plus 1 year"
    
      # Data interchange
        ExpiresByType application/atom+xml                  "access plus 1 hour"
        ExpiresByType application/rdf+xml                   "access plus 1 hour"
        ExpiresByType application/rss+xml                   "access plus 1 hour"
    
        ExpiresByType application/json                      "access plus 0 seconds"
        ExpiresByType application/ld+json                   "access plus 0 seconds"
        ExpiresByType application/schema+json               "access plus 0 seconds"
        ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
        ExpiresByType application/xml                       "access plus 0 seconds"
        ExpiresByType text/xml                              "access plus 0 seconds"
    
      # Favicon (cannot be renamed!) and cursor images
        ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
        ExpiresByType image/x-icon                          "access plus 1 week"
    
      # HTML - Beh‰lt die Website eine Stunde im Cache, neues wird erst nach Ablauf einer Stunde
      # angezeigt. Wenn nicht gewuenscht, bei 3600 eine Null eintragen
        ExpiresByType text/html                             "access plus 3600 seconds"
    
      # JavaScript
        ExpiresByType application/javascript                "access plus 1 year"
        ExpiresByType application/x-javascript              "access plus 1 year"
        ExpiresByType text/javascript                       "access plus 1 year"
    
      # Manifest files
        ExpiresByType application/manifest+json             "access plus 1 week"
        ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
        ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
      # Media files
        ExpiresByType audio/ogg                             "access plus 1 month"
        ExpiresByType image/bmp                             "access plus 1 month"
        ExpiresByType image/gif                             "access plus 1 month"
        ExpiresByType image/jpeg                            "access plus 1 month"
        ExpiresByType image/png                             "access plus 1 month"
        ExpiresByType image/svg+xml                         "access plus 1 month"
        ExpiresByType image/webp                            "access plus 1 month"
        ExpiresByType video/mp4                             "access plus 1 month"
        ExpiresByType video/ogg                             "access plus 1 month"
        ExpiresByType video/webm                            "access plus 1 month"
    
      # Web fonts
    
        # Embedded OpenType (EOT)
        ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
        ExpiresByType font/eot                              "access plus 1 month"
    
        # OpenType
        ExpiresByType font/opentype                         "access plus 1 month"
    
        # TrueType
        ExpiresByType application/x-font-ttf                "access plus 1 month"
    
        # Web Open Font Format (WOFF) 1.0
        ExpiresByType application/font-woff                 "access plus 1 month"
        ExpiresByType application/x-font-woff               "access plus 1 month"
        ExpiresByType font/woff                             "access plus 1 month"
    
        # Web Open Font Format (WOFF) 2.0
        ExpiresByType application/font-woff2                "access plus 1 month"
    
      # Other
        ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    </IfModule>
    
    <IfModule mod_deflate.c>
    # Insert filters / compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/vtt 
    AddOutputFilterByType DEFLATE text/x-component
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/js
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/atom+xml 
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/ld+json 
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/font-woff2
    AddOutputFilterByType DEFLATE application/x-font-woff
    AddOutputFilterByType DEFLATE application/x-web-app-manifest+json font/woff
    AddOutputFilterByType DEFLATE font/woff 
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon 
    
    # Exception: Images
    SetEnvIfNoCase REQUEST_URI \.(?:gif|jpg|jpeg|png|svg)$ no-gzip dont-vary
    
    # Drop problematic browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    
    #Alternative caching using Apache's "mod_headers", if it's installed.
    #Caching of common files - ENABLED
    <IfModule mod_headers.c>
    <FilesMatch "\.(ico|pdf|flv|swf|js|css|gif|png|jpg|jpeg|txt)$">
    Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    </IfModule>
    
    # Set Keep Alive Header
    <IfModule mod_headers.c>
        Header set Connection keep-alive
    </IfModule>
    
    # If your server don't support ETags deactivate with "None" (and remove header)
    <IfModule mod_expires.c> 
      <IfModule mod_headers.c> 
        Header unset ETag 
      </IfModule> 
      FileETag None 
    </IfModule>
    
    <IfModule mod_headers.c>
    <FilesMatch ".(js|css|xml|gz|html|woff|woff2|ttf)$">
    Header append Vary: Accept-Encoding
    </FilesMatch>
    </IfModule>
    
    # No access to the install.php
    <files install.php>
    Order allow,deny
    Deny from all
    </files>
     
    # No access to the wp-config.php 
    <files wp-config.php>
    Order allow,deny
    Deny from all
    </files>
     
    # No access to the readme.html
    <files readme.html>
     Order Allow,Deny
     Deny from all
     Satisfy all
    </Files>
     
    # No access to the liesmich.html for DE Edition
    <Files liesmich.html>
     Order Allow,Deny
     Deny from all
     Satisfy all
    </Files>
     
    # No error log access 
    <files error_log>
    Order allow,deny
    Deny from all
    </files>
    
    #No access to the .htaccess und .htpasswd
    <FilesMatch "(\.htaccess|\.htpasswd)">
      Order deny,allow
      Deny from all
    </FilesMatch>
    
    # Block access to includes folder
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteCond %{HTTP_REFERER}     !^$
     RewriteCond %{REQUEST_FILENAME} -f
     RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$           [NC]
     RewriteCond %{HTTP_REFERER}     !^https?://([^.]+\.)?domain\. [NC]
     RewriteRule \.(gif|jpe?g?|png)$                             - [F,NC,L]
    </ifModule>
    
    <IfModule mod_rewrite.c>
        RewriteCond %{REQUEST_METHOD} .* [NC]
        RewriteCond %{THE_REQUEST}  (YesThisIsAReallyLongRequest|ScanningForResearchPurpose) [NC,OR]
        RewriteCond %{QUERY_STRING} (YesThisIsAReallyLongRequest|ScanningForResearchPurpose) [NC]
        RewriteRule .* - [F,L]
    </IfModule>
    
    ## No-Referrer-Header
    <IfModule mod_headers.c>
        Header set Referrer-Policy "no-referrer"
    </IfModule>

    Gerne, war ein interessanter Bug. Danke für die Rückmeldung.
    Falls du den Fehler in der .htaccess eingrenzen willst, hier sind weitere Informationen.

    Daniel XAG

    (@fibmyefriblot_doj)

    Hast Du denn herausgefunden, was in der htaccess die Ursache war?

    Wenn ich mir die Beschreibung von „Block Nuisance Requests“ ansehe, könnte ich mir nun vorstellen, dass in Deiner Site Objekte vorkommen, die zu einer 404-Antwort führen (Datei nicht gefunden). Die Browser fordern die Objekte erneut an, das Plugin sperrt sie daraufhin.
    Jetzt fällt mir auch ein, dass Edge auf der Webkit-Engine von Safari aufbaut. Wenn Webkit also eine bestimmte Vorgehensweise hat, andere Browser(-Engines wie Gecko) aber andere Workarounds für 404-Antworten, wer hat dann „Schuld“? Die Browser? Das Plugin? Die Server?
    Das Problem ist jedenfalls aufgetreten, eben weil die Browser etwas angefragt haben (und nicht blockiert, wie ich annahm). Jedenfalls sind die Browser Teil der Ursache.

    • Diese Antwort wurde geändert vor 4 Jahren, 10 Monaten von Daniel XAG. Grund: weitere Erläuterungen

    Hallo Daniel-X, @fibmyefriblot_doj

    Das Problem ist gelöst, daher habe ich den Thread geschlossen und deine letzte Antwort archiviert. Das ist ein Forum, wo Benutzer anderen Benutzern dabei helfen, Probleme zu lösen und das ist geschehen. Die Fehler waren nach Deaktivierung der Datei .htaccess verschwunden.

    Wenn du irgendwelche Theorien diskutieren willst, ist das hier nicht das richtige Forum.

    Hi!

    Ich finde die Diskussion über die genaue Ursache durchaus interessant.

    Ich denke auch, dass es am „BLOCK NUISANCE REQUESTS“ liegt. Laut Kommentar in der Datei soll man es nicht benutzen, wenn „.well-known“ genutzt wird.

    Das könnte aber bei dem genutzten AlphaSSL-Zertifikat durchaus auch benutzt werden, wenn ich das richtig interpretiere:
    https://support.globalsign.com/customer/en/portal/articles/1345666-performing-domain-verification—http-verification-method

    Das wäre die Erklärung für einen 403er.

    Aber warum nur Bilder und nur bestimmte Browser?

    Der Sinn dieses Abschnittes erschließt sich mir auch nicht wirklich:

     RewriteEngine on
     RewriteCond %{HTTP_REFERER}     !^$
     RewriteCond %{REQUEST_FILENAME} -f
     RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$           [NC]
     RewriteCond %{HTTP_REFERER}     !^https?://([^.]+\.)?domain\. [NC]
     RewriteRule \.(gif|jpe?g?|png)$                             - [F,NC,L]

    Hotlink-Schutz vielleicht? Dann scheint aber die Domain nicht angepasst worden zu sein …

    Der Rest sieht eigentlich ganz okay aus.

    Gruß, Torsten

    @stefansic

    Ich hab deine .htaccess-Datei kopiert und das in eine leere .htaccess-Datei eingefügt. Im Text wurde nur die Domain angepasst, sonst nichts. Das ganze wurde dann auf eine (Test)-Website von mir, die nur WordPress 5.2.1 und ein Standard-Theme enthält, hochgeladen. Die Website ist auch mit einem SSL-Zertifikat verschlüsselt und per https aufrufbar.

    Ich konnte den Fehler in IE 11 und Edge reproduzieren, dort wurden mir also auch keine Bilder angezeigt. Das Entfernen von

    # ----------------------------------------------------------------------
    # | BLOCK NUISANCE REQUESTS - New in 2018  
    #   https://perishablepress.com/block-nuisance-requests
    # ----------------------------------------------------------------------
    
    # Comment it out, if you don't use Let's Encrypt, because Let's Encrypt ist using .well-known
    # Wenn Du Let's Encrypt nutzt, kannst Du das nicht verwenden, weil Let's Encrypt .well-known nutzt.
    <IfModule mod_alias.c>
    	RedirectMatch 403 (?i)\.php\.suspected
    	RedirectMatch 403 (?i)\.(git|well-known)
    	RedirectMatch 403 (?i)apple-app-site-association
    	RedirectMatch 403 (?i)/autodiscover/autodiscover.xml
    </IfModule> 

    hat den Fehler nicht behoben.

    Aber der Eintrag, den Torsten bereits nannte und den ich auch insgeheim in Verdacht hatte. ‚Wenn ich nur diesen nachfolgenden Code entferne, werden mir die Bilder im IE 11 und Edge wieder angezeigt:

    <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteCond %{HTTP_REFERER}     !^$
     RewriteCond %{REQUEST_FILENAME} -f
     RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$           [NC]
     RewriteCond %{HTTP_REFERER}     !^https?://([^.]+\.)?domain\. [NC]
     RewriteRule \.(gif|jpe?g?|png)$                             - [F,NC,L]
    </ifModule>

    Hast du irgendeine Idee, wie dieser Code in deine .htaccess gelangt ist? Denn wenn es – wie ich vermute – durch ein (Security- oder Galerie-) Plugin eingefügt wurde, könnte das beim nächsten Update erneut passieren. Googelt man den Code, deutet alles auf einen Schutz vor Hotlinking hin. Man sollte den Entwickler über diesen Bug informieren.

    Thread-Starter stefansic

    (@stefansic)

    Super, das wäre dann geklärt!

    Was macht denn überhaupt Sinn in der htaccess?

    LG Stefan

    Was macht denn überhaupt Sinn in der htaccess?

    Es gibt viele sicherheitsrelevante und performance-relevante Optimierungen, die in einer .htaccess vorgenommen werden können:
    Siehe:
    https://gist.github.com/Zodiac1978/d25a8f3aebba7cd1c01c
    oder:
    https://gist.github.com/Zodiac1978/3145830

    Ich versuche mal den obigen Code zu erläutern:

    <IfModule mod_rewrite.c>
    </ifModule>

    Das sorgt dafür, dass der Code nur ausgeführt wird, wenn das entsprechende PHP-Modul auch vorhanden ist.

    RewriteEngine on

    Hier das Rewrite-Modul aktiviert. Jetzt werden Bedingungen (Cond=Conditions) gesetzt, die für die nachfolgende Regel (Rule) gelten müssen:

    RewriteCond %{HTTP_REFERER} !^$

    Der Referrer-Header (also die verweisende Website) darf nicht (!=Verneinung) leer sein. (^ = Start, $ = Ende)

    RewriteCond %{REQUEST_FILENAME} -f

    Die Anfrage muss eine existierende Datei sein (f=file, d=directory).

    RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$ [NC]

    Der Dateiname muss auf .gif, .jpeg, .jpg oder .png enden. Groß/Kleinschreibung egal, NC=No Case.

    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?domain\. [NC]

    Das ist jetzt entscheidend: Die verweisende Website darf nicht anfangen mit http oder https :// – aus dem nächsten Block werde ich nicht wirklich schlau und domain.

    RewriteRule \.(gif|jpe?g?|png)$ - [F,NC,L]

    Das ist die Rewrite-Regel, die keinen Rewrite enthält, sondern nur ein Pattern. F=Forbidden, sorgt für den 403, NC=Nocase ignoriert GRoß/Kleinschreibung und L steht für Last – weitere regeln danach werden also nicht mehr beachtet.

    Sieht für mich nach einer Blacklist aus, „domain“ wird ersetzt durch die URL, die man blacklisten möchte. Sofern der Rest des Codes auf dem eigenen Webspace denn das tut, was man will …

    Gruß, Torsten

Ansicht von 8 Antworten - 16 bis 23 (von insgesamt 23)
  • Das Thema „Safari 11.1.x und Edge zeigen keine Bilder an“ ist für neue Antworten geschlossen.