.htaccess two different rules but only one per time
- by dragon112
I'm rather new to the whole .htaccess thing and I'm using the following right now to use 'pretty url's':
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?path=$1 [NS,L]
</IfModule>
Now i found my website a bit slow and decided to start gzipping my CSS files thru a php script I found somewhere on the web (the website). For this to work I need to rewrite the url to open the correct php file. That would look something like this:
RewriteRule ^(.*).css$ /csszip.php?file=$1.css [L]
But I only want the first to happen when the second doesn't and vice versa. In other words i'd like something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
if request doesn't contain .css do
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?path=$1 [NS,L]
else do
RewriteRule ^(.*).css$ /csszip.php?file=$1.css [L]
</IfModule>
Can anyone help me with the proper code or a place where i can find a way to use some kind of conditional statement in htaccess files?
Thanks in Advance!:)