.htaccess Mime-Type wrong

  • Hallo,


    ich versuche eine Wordpress-Seite (Netcup Hosting 2000) auf eine Nuxt App zu leiten mit folgender .htaccess:


    Beim Laden der Page bekommt ich beim Laden der Ressourcen immer ein:

    Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.


    Hat dafür jemand eine Lösung?

    Vielen Dank im Voraus! :)

  • Zur hilfreichsten Antwort springen
  • Ich schätze einmal, dass der Reihenfolge RewriteRules

    Apache Configuration
    RewriteBase /
    
    RewriteRule ^index\.php$ - [L]

    Zuerst ausgeführt wird und das L tut das Übrige.


    https://httpd.apache.org/docs/trunk/rewrite/flags.html#flag_l


    The [L] flag causes mod_rewrite to stop processing
    the rule set. In most contexts, this means that if the rule matches, no
    further rules will be processed. This corresponds to the
    last command in Perl, or the break command in
    C. Use this flag to indicate that the current rule should be applied
    immediately without considering further rules.


    Lösung: spezifischere Regeln nach oben. Allgemeine nach unten.

  • Ich habe testweisen

    Apache Configuration
    RewriteRule ^index\.php$ - [L]

    rausgenommen, bringt aber nichts

    Schau Dir doch einmal in der Browserkonsole (F12), vielleicht über die Netzwerkanalyse an, was denn da für ein Inhalt (Antwort) ausgeliefert wird. Entweder, der Mime-Type ist falsch oder das Ziel. Und bei Deinem Regelwerk tippe ich jetzt erst einmal auf Letzteres.