When using cssrewrite I am getting the incorrect paths. It works fine when using the app_dev.php or app.php in the URL, for example, mysite.com/site/app.php/login
will correctly function. However, using mysite.com/site/login
will not work.
When viewing the CSS files I see the following while accessing mysite.com/site/app.php/login
:
src: url('../../bundles/acmetest/font/fontawesome-webfont.eot?#iefix&v=3.2.1')
The correct path when viewing mysite.com/site/login should be:
src: url('../bundles/acmetest/font/fontawesome-webfont.eot?#iefix&v=3.2.1')
Here is my htaccess file:
DirectoryIndex app.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /app.php/
</IfModule>
</IfModule>
Is there a way to configure the production environment to know that its path is /
, not app.php/
so that it correctly configures the cssrewrite paths?
Here is my Twig configuration for assetic:
{% block stylesheets %}
{% stylesheets
'bundles/acmetest/css/bootstrap.min.css'
'bundles/acmetest/css/jquery-ui-1.10.3.custom.min.css'
'bundles/acmetest/css/jquery.iphone.toggle.css'
'bundles/acmetest/css/font-awesome.css'
'bundles/acmetest/css/glyphicons.css'
'bundles/acmetest/css/halflings.css'
'bundles/acmetest/css/retina.min.css'
'bundles/acmetest/css/style.css'
filter='cssrewrite'
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
{% endblock %}