kreut — 2013-04-06T21:37:58-04:00 — #1
I'm taking my first stab at creating a mini-MVC to better understand the concepts behind such a design. I'm using:
RewriteCond %[REQUEST_FILENAME] !-d
RewriteCond %[REQUEST_FILENAME] !-f
RewriteCond %[REQUEST_FILENAME] !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
to rewrite my URLS and it works great except for my css and js files. I thought that the "!-f" line would take care of these, but if I run a script with:
<link rel="stylesheet" href="public/css/default.css" />
then, I think that it's still treating my link as something to be rewritten. Any help with this would be appreciated.
jeff_mott — 2013-04-07T00:07:52-04:00 — #2
Indeed it should. Are you sure the CSS URL is correct? Perhaps it should be /css/default.css? What makes you think it's rewriting your link?
jeff_mott — 2013-04-07T01:17:56-04:00 — #3
I just noticed a syntax error. You should be using curly braces, not square brackets.
kreut — 2013-04-07T09:16:29-04:00 — #4
That fixed it! And, for someone who doesn't typically work with Rewrites, for future debugging of this sort, is there a file that I could have viewed that would have told me that there was a syntax error?
dklynn — 2013-04-07T19:07:46-04:00 — #5
No, there isn't. The best thing you can do is SEE any redirection by using the [R=301] flag to test.
kreut — 2013-04-07T20:11:55-04:00 — #6