0

私は多くの検索を行っていますが、解決策が見つかりません。

generator-angular を使用してプロジェクトを生成し、font-awesome を使用していますが、chrome で警告が表示されました

Resource interpreted as Font but transferred with MIME type text/html: "http://gview.com/fonts/fontawesome-webfont.svg?v=4.2.0"

生成された .htaccess ファイルには、フォントの MIME タイプを処理するためのルールがいくつかあることに気付きました。なぜそれが機能しないのかわかりません。

また、ビュー ルートには ui.router を使用し、# を取り除く目的で、次のように .htaccess にいくつかのルールを追加します。

RewriteEngine on

    # Don't rewrite files or directories
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Rewrite everything else to index.html to allow html5 state links
    RewriteRule ^ index.html [L]

どこが間違っているのかわかりません。

どうもありがとう。

4

1 に答える 1

0

Grunt を使用してアプリケーションを提供している場合は、他のファイル拡張子を通過できるように小さな変更を加える必要がある場合があります。

connect: {
        options: {
            port: 9000,
            // Change this to '0.0.0.0' to access the server from outside.
            hostname: 'localhost',
            livereload: 35729
        },
        livereload: {
            options: {
                open: true,
                middleware: function (connect) {
                    return [
                        modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.woff|\\.ttf|\\.gif$ /index.html [L]']),

Gruntfile の modRewrite をチェックして、必要なファイル拡張子がすべて含まれていることを確認してください。

于 2015-04-06T13:12:46.063 に答える