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

I have an Apache virtual host for a project I have done using Silex which is based on Symfony2 however the routing works fine with the modrewrite rules but all calls to javascript or css seem to turn into routes to a controller. Could you help me with the virtual host please.

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L]
DocumentRoot /var/www/html/site/www
share|improve this question
1  
Where's this configuration? –  Shane Madden Apr 23 '12 at 17:35
    
in the httpd.conf –  OliverBS Apr 23 '12 at 17:39
add comment

1 Answer

up vote 2 down vote accepted

%{REQUEST_FILENAME} is relative the the DocumentRoot. The above works within a <Directory...> block (or .htaccess file). Try changing it to:

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule .* /index.php [L]
share|improve this answer
    
Perfect thank you very much :) –  OliverBS Apr 23 '12 at 18:22
add comment

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.