yii2 css file won't load because it's MIME type text/html is not text/css on windows7 apache server

假装没事ソ 提交于 2020-01-06 18:06:40

问题


I'm starting on Yii2, and i want to change the theme. So far I've downloaded theme from http://yii2.themefactory.net and followed this steps

'view' => [
  'theme' => [
       'pathMap' => ['@app/views' => '@app/themes/mytheme'],
       'baseUrl' => '@web/themes/mytheme',
    ],
  ],

on config/web.php file. Now when I try to load the site I got this

css file won't load because it's MIME type text/html is not text/css


回答1:


configure your apache server. Your mime types are probably wrong.

You'll need mod_mime apache module enabled, and ensure you have these lines in your httpd.conf (or .htaccess)

AddType text/css .css


来源:https://stackoverflow.com/questions/41769001/yii2-css-file-wont-load-because-its-mime-type-text-html-is-not-text-css-on-win

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!