1
Hello guys I am working on an MVC project but I came across a css error that had never happened to me. By staging CSS the browser returns me a rendering error.
in firefox:
12:08:16.973 The style sheet http://localhost/portfolio/Generic.css was loaded as CSS, although its mime type, "text/html", is not "text/css". 1 portfolio
On google Chrome:
Resource Interpreted as Stylesheet but transferred with MIME type text/html:
Does anyone know what it can be?
You are using windows and apache?
– Guilherme Nascimento
Maybe at the time of import you have not inferred that it is a "stylesheet".
– ptkato
I am using Buntu and apache, I have tested permissions and nothing, I read an article where the guy puts in htaccess the following code : Rewritecond %{SCRIPT_FILENAME} ! -f Rewritecond %{SCRIPT_FILENAME} ! -d tested here and it worked, but I don’t know if it’s more feasible to do this.
– Lourençon O.
This code has nothing to do with this, this code is for rewritten urls, tell me you’re using
.htaccess, has how to post it in the question?– Guilherme Nascimento
This seems like an error in setting up apache! Do you have access to the /etc/apache2/mime.types file? Do you know if there are any css entries in it?
– PerryWerneck
It is probably apache configuration, you said it is MVC, usually in MVC there is a folder for static public content that is configured in apache not to show the private code folders, your css is in a direct location like
/var/www/portfolio/generic.cssor in another sub-folder as/var/www/portfolio/public/generic.css?– Jairo Correa
You’re right @Jairocorrea now that I’ve noticed this. Brendol please let me know which MVC framework you’re using.
– Guilherme Nascimento