Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.