eZ Community » Forums » eZ Publish 5 Platform » Legacy Assets - css+js+images 404 error
expandshrink

Legacy Assets - css+js+images 404 error

Legacy Assets - css+js+images 404 error

Wednesday 16 December 2015 3:31:55 pm - 2 replies

I just upgraded to ezpublish5 and am now having a difficult time getting my css + js + images working. Those asset folders are located in my web root directory (/var/www) and I have symlinked those folders into my ezpublish/web folder. If I change my virtual host environment variable from dev to prod my css and js files load however the images return 404 errors. If I'm in dev mode then I get 404 for css + js + images. I have run all the console commands for dumping assets for dev and prod environments. These are all legacy assets from my old ezpublish 4.2 install however they need to remain in the web root for now. Is there more apache config settings I'm missing?

Modified on Wednesday 16 December 2015 3:44:10 pm by Travis Raup

Friday 18 December 2015 1:46:44 pm

I had to modify my virtual host to allow for /css /js and /images folders to work.

<span class="com">#RewriteCond %{ENV:ENVIRONMENT} "prod"</span><span class="pln"></span><span class="com">#RewriteRule ^/(css|js)/.*\.(css|js) - [L]</span><span class="pln"></span><span class="typ">RewriteRule</span><span class="pln"> </span><span class="pun">^</span><span class="str">/css/</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="pun">[</span><span class="pln">L</span><span class="pun">]</span><span class="pln"></span><span class="typ">RewriteRule</span><span class="pln"> </span><span class="pun">^</span><span class="str">/js/</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="pun">[</span><span class="pln">L</span><span class="pun">]</span><span class="pln"></span><span class="typ">RewriteRule</span><span class="pln"> </span><span class="pun">^</span><span class="str">/images/</span><span class="pln"> </span><span class="pun">-</span><span class="pln"> </span><span class="pun">[</span><span class="pln">L</span><span class="pun">]</span>

My legacy templates are now loading properly with symlinked folders from my web root. I'm not sure if this will affect the symfony asset management but at least now I can start moving forward with refactoring legacy code into symfony/twig code. 

Wednesday 02 March 2016 2:47:20 pm

Im not sure if this will work for the cached prod environement. I suggest to move the css,js and images in the bundle  ..Resources/public  and define the css and js files in page_head_script.html.twig and page_head_style.html.twig.

so you will be able to work with the assetic:dump for dev and prod and share the css /js with legacy .

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from