0

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
2
2

%{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]
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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