mod_rewrite blocking CSS

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

mod_rewrite blocking CSS

Post 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?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

it seems to be redirecting your css request... you'll have to specify it not to do that
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Hint: you need a RewriteCond
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Post 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.
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Post 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?
Post Reply