Saturday, 15 March 2014

css - Symfony2 - assetic background images on subdomain -



css - Symfony2 - assetic background images on subdomain -

i have 2 bundles in symfony 2.2

1. frontbundle on domaint.tld

domain.tld/symfony/src/comapny/frontbundle/resources/public/css domain.tld/symfony/src/comapny/frontbundle/resources/public/images domain.tld/symfony/src/comapny/frontbundle/resources/public/js

2. adminbundle on admin.domain.tld

domain.tld/symfony/src/comapny/adminbundle/resources/public/css (custom.css) domain.tld/symfony/src/comapny/adminbundle/resources/public/images (image.png) domain.tld/symfony/src/comapny/adminbundle/resources/public/js

domain.tld/symfony/src/comapny/adminbundle/resources/public/css/custom.css

div.image { background-image: url(../images/image.png); }

domain.tld/symfony/app/config/config.yml

debug: "%kernel.debug%" use_controller: false bundles: [ adminbundle, frontbundle ] read_from: "%kernel.root_dir%/../../public_html/" write_to: "%kernel.root_dir%/../../public_html/" filters: cssrewrite: ~

domain.tld/symfony/app/config/routing.yml

admin: host: "admin.domaint.tld" resource: "@adminbundle/controller/" type: annotation front: host: "domain.tld" resource: "@frontbundle/controller/" type: annotation

domain.tld/symfony/src/company/adminbundle/resources/views/layout.html.twig

{% stylesheets 'bundles/admin/css/custom.css' filter='cssrewrite,?yui_css' %} <link rel="stylesheet" href="{{ asset_url }}"/> {% endstylesheets %}

i use

app/console cache:clear app/console assets:install ../public_html --symlink app/console assetic:dump

--

problem

on domain.tld works ok, problem on subdomain.

source code admin.domain.tld

<link rel="stylesheet" href="/css/8d488cd_custom_11.css"/>

8d488cd_custom_11.css

div.image { background-image: url(../../bundles/admin/images/image.png); }

from firebug

"networkerror: 404 not found - http://admin.domain.tld/bundles/admin/images/image.png"

any thought how right code or configuration (css backgrounds) working subdomain , root domain ?

solved. problem apache domain configuration. works ok.

css symfony2 assetic symfony-2.2

No comments:

Post a Comment