Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using this in my conf:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$      /index.php?page=$1 [QSA]

But files such as /theme/styles.css still get redirected to index.php

Does anyone know why this doesn't work?

share|improve this question
Is this in an .htaccess, or in the apache conf? If in an .htaccess, have you correctly set the RewriteBase? – Steven Monday Nov 14 '10 at 15:52

Just a note, /theme/styles.css is a REQUEST_URI not a REQUEST_FILENAME; the _FILENAME is a full path on disk. Try adding debugging to see what is being evaluated:

RewriteLog /tmp/rewrite.log
RewriteLogLevel 3

Find the relevant section of your request in the log and it should show you what's wrong, but if not then paste it for us to see.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.