1 Vote Vote

apache rewrite rule not working...trying to combine css and javascript

Posted by topdog 483 days ago Questions| css javascript combine All

using php5, apache2.2

I'm trying to combine my css and javascript files into one file as per this tutorial: http://rakaz.nl/2006/12/make-your-pages-load-faster-by-combining-and-compressing-javascript-and-css-files.html

I don't think the .htaccess rewrite is working right. Here's my .htaccess file:

<IfModule mod_rewrite.c>
    RewriteRule ^css/(.*\.css) combine.php?type=css&files=$1
    RewriteRule ^javascript/(.*\.js) combine.php?type=javascript&files=$1
</IfModule>

I've tried exactly what was put in the tutorial for the .htaccess, but got a "forbidden" error, so the above is the only thing I got to work and at least not throw an error.

The webpage loads all the content, but just doesn't load the .css, or javascript. I put some debugging inside the "combine.php" page to see if that page even gets called and I get nothing. So I'm thinking that the rewriterule is wrong...but I don't know how to fix it.

Here's how I include it into the html:

<link rel="stylesheet" type="text/css" href="http://dev.redsandz.com/css/layout_2col.css,general.css" />

There are more than 100 posts of people saying it worked...i'm just not one of them.

Can anyone help? Thanks.

Originally asked by: Ronedog on Stack Overflow

Discuss Bury


Who Voted for this Question