PTED为脚本,但MIME类型的文本传输的.htaccess资源跨$ P $ / HTML [英] .htaccess Resource interpreted as Script but transferred with MIME type text/html

查看:185
本文介绍了PTED为脚本,但MIME类型的文本传输的.htaccess资源跨$ P $ / HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的问题后,我加入这行到我的htaccess的:

I've a big problem after I add this line into my htaccess:

RewriteRule ([a-z]+)/   index.php?p=$1 [L]

我有这样的错误:

I have error like that:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/media/css/lvnr.min.css".
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost/media/js/bootstrap.min.js".

我觉得现在的问题是,我的htaccess的尝试重定向所有链路媒体/ ......到index.php?P = ......

I think that the problem is that my htaccess try to redirect all the link media/... to index.php?p= ...

那么如何解决这个问题,请

So how to fix it please

推荐答案

正如你已经假定,您的规则相匹配的媒体/ ... 你可能希望你的正则表达式来结束$:

As you already assumed, your rule matches your media/... You probably want your regex to end on $:

RewriteRule ([a-z]+)/$   index.php?p=$1 [L]

编辑:另外你可能会感兴趣的装载从CDN有更好的表现,公共图书馆像自举:

Also you might be interested in loading public libraries like boostrap from a CDN for better performance:

<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

这篇关于PTED为脚本,但MIME类型的文本传输的.htaccess资源跨$ P $ / HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆