Magento 2 – CSS / Template is not displayed

After a Magento migration (Liveshop –> Testshop) fell on, that there are problems with the template or. when viewing the page. The content was there, but the CSS was not displayed and the structure was missing = the specially written template for the shop was not loaded.

Now check the files, saw, that the directory /pub/static/frontend/NAME/Theme/de_DE was almost empty. Only one requirejs-config.js was ever flying around in the directory.

We had set the shop to developer mode, where many of the template files are symlinked to the app/design directory. If you have now given the deploy command via SSH

php bin/magento setup:static-content:deploy -f

the data was stored and the page was displayed correctly. A short time later, however, all directories and files were lost again and only the above-mentioned. requirejs file was still there.

The idea regarding. wrong write permissions (CHMOD) stood in the room, did not bring anything. In the end, that was the mistake, that the .htaccess file from the /pub/static folder was lost. You can, for example,. from the Magento repository 2 on github (HERE) get it and put it back in the directory.

Then there are no more problems with the template.

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *