Page 1 of 1

mod_rewrite blocking CSS

Posted: Tue Jan 23, 2007 9:26 pm
by psurrena
My mod_rewrite is:

Code: Select all

RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)$ /view.php?title=$1&id=$2 [L]
It works just fine except now my css file won't load on any page? The top portion of my page is an include and the css is linked through that:

Code: Select all

<link rel="stylesheet" href="library/style.css" />
Any idea?

Posted: Tue Jan 23, 2007 9:46 pm
by Kieran Huggins
it seems to be redirecting your css request... you'll have to specify it not to do that

Posted: Tue Jan 23, 2007 9:59 pm
by feyd
Hint: you need a RewriteCond

Posted: Wed Jan 24, 2007 12:02 am
by psurrena
I got it to work by typing in the full path the to css file.

It still won't work on my Mac running Apache 1.3.33, I get a 404 error which tells me my mod_rewrite still isn't correct.

Once I get the RewriteCond figured out I'll post it.

Posted: Wed Jan 24, 2007 3:34 pm
by psurrena
alright - I can't find any good examples using the RewriteCond. Every example I've seen that is similar to mine just uses RewriteRule. Can you give me one more hint?