cancel
Showing results for 
Search instead for 
Did you mean: 

CSS and JS not loading with muliti website and admin

SOLVED

CSS and JS not loading with muliti website and admin

After running command rm -rf pub/static/* var/view_preprocessed/* var/cache/* and deployed done CSS and JS are not loading.

 

CSS and JS URL showing with static version is for admin and front end but showing 404 error.

 

I checked the files for particular directory JS and CSS are there.

 

How I can fix this

 

Please help.

 

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: CSS and JS not loading with muliti website and admin

Hi @johdanlusefa34 

 

You can follow the below simple solution if the version name showing in CSS and JS path 

 

eg: pub/static/version3287934/

 

then you run below database query in my sql :

 

INSERT INTO core_config_data (path, value) 
VALUES ('dev/static/sign', 0) 
ON DUPLICATE KEY UPDATE value = 0;

After then clear config cache

 

php bin/magento cache:clean config

 

you can also disable static file version form admin :

 

Store->configuration -> Advanced -> Developer -> Static file settings

Set Sign Static files - No

 

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

View solution in original post

3 REPLIES 3

Re: CSS and JS not loading with muliti website and admin

Hi @johdanlusefa34 

 

You can follow the below simple solution if the version name showing in CSS and JS path 

 

eg: pub/static/version3287934/

 

then you run below database query in my sql :

 

INSERT INTO core_config_data (path, value) 
VALUES ('dev/static/sign', 0) 
ON DUPLICATE KEY UPDATE value = 0;

After then clear config cache

 

php bin/magento cache:clean config

 

you can also disable static file version form admin :

 

Store->configuration -> Advanced -> Developer -> Static file settings

Set Sign Static files - No

 

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: CSS and JS not loading with muliti website and admin

Hello @johdanlusefa34 

 

follow @Madhu Rajawat and also give permission to folder by command :

sudo chmod -R 777 pub/static/ pub/media/

And try with the permissions.

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: CSS and JS not loading with muliti website and admin

Thanks @Madhu Rajawat Resolved.

@gaurav_harsh1  There is no need to give file permission when we do configuration changes I think We need to clean config cache only.