[thelist] FilesMatch/ForceType leads to CSS death?

Amanda Kuek amandakuek at gmail.com
Sat Sep 10 08:48:24 CDT 2005

Well, that's a tad dramatic, but I am stumped.

Basically, in the course of trying to have nice URLs, my CSS seems to
have fallen over.

I have a URL that looks like this:


Obviously, it displays the news item which has an ID of 32.

Now, I wanted a nice URL that looked like this:


Because Netspace doesn't seem to have mod_rewrite, I resorted to
putting the following into an .htaccess file...

<FilesMatch "^news$"> 
  ForceType application/x-httpd-php

...and lopping the ".php" off the end of the file called "news.php". 

Unfortunately, looking at 
http://www.example.com/trial/news/32 will show you that the external
style sheet (example.css) is not being loaded.

Now, according to Firefox, it's not being loaded because...

Error: The stylesheet http://www.example.com/trial/news/example.css was
not loaded because its MIME type, "text/html", is not "text/css".

Does anyone have any clue on how to get around this? Is this because
news.php is Strict XHTML? (That was giving me problems before with
firefox: had to encase the css file in a PHP file (with an include())
then use <link rel="stylesheet" type="text/css" media="all"
href="example.css.php" />)

Thanks very much for any suggestions. And sorry if this is a really
obvious question.

More information about the thelist mailing list