Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess Resource interpreted as Script but transferred with MIME type text/html

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".

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

like image 388
Splinteer Avatar asked Jan 25 '26 18:01

Splinteer


1 Answers

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]

Edit: 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>
like image 162
Sebastian S Avatar answered Jan 28 '26 06:01

Sebastian S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!