0

Problem is about CakePhp. If I give permission to required directories CSS does not work. Sample URL: link text

Isn't this weird?

1 Answer 1

1

It works in IE: It's a Firefox specific problem.

Your CSS file is not outputting the Content-type: text/css header, which makes Firefox ignore it as a style sheet. You will notice a warning to that effect in Firefox's error console.

I don't know Cake, but I'm sure there is a native way to remedy this.

A quick fix would be adding

<?php
  header("Content-type: text/css");

?>

to the top of cake.generic.css (if that is a PHP file).

If it's a real CSS file and not a rewritten URL (as I said, I don't know Cake), your web server doesn't seem to be taking care of sending the right content type - maybe something for the admin to fix.

If the admin can't fix it, you could try adding a .htaccess file to your project (or editing the existing one) containing

AddType text/css .css
Sign up to request clarification or add additional context in comments.

1 Comment

Oh thanks Pekka. I added below code to my .htaccess file. <FilesMatch "\.(css)$"> SetHandler text/css </FilesMatch>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.