RewriteRule to exclude CSS
Posted: Tue Jun 02, 2009 2:52 pm
I've got a simple .htaccess file which contains:
This basically just sends everything to my front controller.
I'm using my HTML template in quite a dodgey (probably poor) fashion, as below.
layout.php is basically just a HTML template with some bits of PHP in it. I'm trying to include my stylesheet in it with this line.
style.css is in the same directory as layout.php (frontend). I've tried loads of paths (even absolute paths) to try get to my CSS file but it's not working. I guess it's something to do with the .htaccess file. Does anyone know how I can correct it?
Thanks.
Code: Select all
RewriteEngine On
RewriteRule !^(css|images|files)/ index.php [NC,L]
ErrorDocument 404 /I'm using my HTML template in quite a dodgey (probably poor) fashion, as below.
Code: Select all
//Grab the HTML template
ob_start();
include 'frontend/layout.php';
$template = ob_get_contents();
ob_end_clean();
$templateBits = explode('***CONTENT***', $template);
$header = $templateBits[0];
$footer = $templateBits[1];
//Output the page header
echo $header;
// ...
//Output the page footer
echo $footer;
Code: Select all
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />Thanks.