cancel
Showing results for 
Search instead for 
Did you mean: 

am getting 404 error for css and js in magento 2

am getting 404 error for css and js in magento 2

Hi guys ,

                 am getting css and js 404 err0r . belw the error details.

 

GET http://183.83.218.131:8888/naturals/pub/static/frontend/Sm/maximum/en_US/images/loading.svg 404 (Not Found)
require.js:1895 GET http://183.83.218.131:8888/naturals/pub/static/frontend/Sm/maximum/en_US/Sm_Maximum/js/jquery.wow.js net::ERR_ABORTED 404 (Not Found)
http://183.83.218.131:8888/naturals/pub/static/frontend/Sm/maximum/en_US/Magento_Theme/js/responsive... net::ERR_ABORTED 404 (Not Found).

 

can any one guide me ?

9 REPLIES 9

Re: am getting 404 error for css and js in magento 2

Did you try deploying files?

 

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

Re: am getting 404 error for css and js in magento 2

yes , but no use

Re: am getting 404 error for css and js in magento 2

you may have error in .htaccess rewrite mod,

Here a part of my .htaccess file from the pub/static (rewrites) :

<IfModule mod_rewrite.c>    RewriteEngine On

    RewriteBase /pub/static
    # Remove signature of the static files that is used to overcome the browser cache
    RewriteRule ^version.+?/(.+)$ $1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule .* ../static.php?resource=$0 [L]</IfModule>

can you please check the .htaccess file.

 

Reference : https://magento.stackexchange.com/questions/150418/static-content-is-not-loading-after-upgrade 

Re: am getting 404 error for css and js in magento 2

its not wokring 

Re: am getting 404 error for css and js in magento 2

How did you fixed it. Getting same in magento 2.4

Re: am getting 404 error for css and js in magento 2

were you able to fix in 2.4? I am still facing this issue after many attempts and tutorials online. Thank you!

Re: am getting 404 error for css and js in magento 2

I have this same problem did you get any answer ?

strona.png

Re: am getting 404 error for css and js in magento 2

Has anybody found a fix for this? We have experienced this same issue after updating from 2.4.1 to 2.4.2 - the files exist and we have a .htaccess file in the pub/static folder but all assets are throwing a 404?

 

Any help would be appreciated.

 

 

Re: am getting 404 error for css and js in magento 2

Please deploy your site for all stores like:

 

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

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