0

I have upgraded to Magento 2.4.3. Upgrade was successful but the layout is not proper. Css and Js are not loading. I have tried every solution but none work. It show 404 not found for images and js function not found or no function defined and for css failed to load resources.

What I checked:

-> a2enmod rewrite is enable
-> apche conf is right
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride All
Require all granted

-> pub/static contain .htaccess file
-> tried to load site through pub folder index.php but no change
-> Run all command setup,di-compile,deploy,cache-clean,flush,permission but no change
-> I have checked all the requirement of Magento and all requirement are satisfied
-> change table value insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);

enter image description here

3
  • Have you created the virtual host and pointed to the index.php in pub directory? Second issue might be of the static file for the particular lanugage check it and try running command for it
    – Asssd
    Oct 25, 2021 at 6:46
  • yes ServerAdmin webmaster@localhost DocumentRoot /var/www/html/m3_up/pub. I have only one language Oct 25, 2021 at 6:48
  • check the store/language for which there are 404 and deploy that particular store/language
    – Asssd
    Oct 25, 2021 at 6:55

1 Answer 1

0

Can you try this below steps...

I think you have a version issue for all the CSS and javascript files.

Step 1 : Remove version from all static file paths. add below query in core_config_data table

insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);

Spep 2 : Run static content deploy cmd again and check.

php bin/magento setup:static-content:deploy -f
2
  • Sorry I forgot to mention but I also tried this Oct 25, 2021 at 7:21
  • Because in the screenshot it's showing the version, just do the ctrl+u in the frontend... Can you check after this you got the version in CSS and js files ? like : pub/static/version323334/ Oct 25, 2021 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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