For a CMS I'm creating I'm implementing dynamic URLs like in
this A List Apart article. Everything works perfectly but there is just something I'd like to better understand.
My .htaccess file looks like this
RewriteEngine on
RewriteRule !\.(gif|jpg|jpeg|png|css)$ index.php
And the part of my index.php file which handles the dynamic URLs looks like this
// Does this file exist?
if (IsURIDynamic() == false) {
// The file exists, simply include it
include($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI']);
} else {
// The file does not exist, the content might be dynamic
// Output template
require_once('template.php');
}
So if the file is a real file (that is, IsURIDynamic() returns false) it is simply included.
And finally, in template.php is the following line
<link rel="stylesheet" href="organs/norm.css" type="text/css" title="Blue" />
Where organs/norm.css is the real path to the actual file.
The part I dont get is that if I remove 'css' from the rewrite rule in the .htaccess file then the stylesheet is not applied to template.php. I can still view the stylesheet if I navigate to its exact location and my Apache logs tell me that it is downloaded correctly when I view template.php but it just seems to not be applied.
Why is the stylesheet not applied when I include() it?