Magento – Magento 2 css and js not working after install

cssjavascriptmagento2

I had a problem with magento 2, where in localhost I created the website and everything was fine, after importing to my server the CSS and JS was not working.

I search for so many answers and still no luck, after awhile I decided to simply start again, so I imported magento to my server, installed it with no errors, but when I entered the home page the CSS and JS does not work.

Here's a couple of things I already tried:

php bin/magento setup:content-static:deploy

deleting the static folder and keep the .htacess and run

 php bin/magento setup:content-static:deploy

Replacing Symlink with Copy

Checking the folders permissions

Here is the link of my website: http://maquinasdeoutrostempos.pt/

Thanks in advance

Best Answer

1] Check whether file permissions are given properly to all the Magento files

2] In your database run below query into "core_config_data" table and check you get any result or not

SELECT * FROM `core_config_data` WHERE `path` LIKE '%static/sign%'

3] If no then run below query

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

or

4] if "dev/static/sign" value is already exist into table set that 1 to 0

run php bin/magento c:f , php bin/magento s:s:d -f

I hope this solve your problem.

Related Topic