thanks in advance for help!
I moved my site based on Magento 2 from hosting to my localhost. I cleared cache, adjusted(secure and unsecure) urls in core_config, run static content deploy() using cli. Checked all permitions for "folder".
Magento runs but with no css and js files.
In console I can see the following:
Please give some advice, what should I do to remove this issue? Thanks in advance!
P.S: Win 10 Open Sever (PHP7x64, MySQL5,7x64, Apache-PHP7-x64+Nginx1.10) No external caching
P.P.S Before I copied site from host I tried to setup magento with sample data using cli and I received the same issue! So I believe it's not only issue about moving magento 2 from host to local. I can see that M2 tries to load all files from version1485628564 folder which doesn't exist in pub/static
http://magehost.two/pub/static/**version1485628564**/frontend/Magento/luma/en_US/mage/calendar.css
You need to run below command on CLI
You need to update the
.htaccess
file under/pub/static
folder. OpenMAGENTO_DIR/pub/static/.htaccess
and add the following code:Alternatively, you can disable static file signing by adding this record into the
core_config_data
table with this query:In this case, keep in mind that you have to flush the cache after executing the query.
As you are using nginx, the htaccess comment above wont help you. You need to add this to your nginx domain config;
Add one more answer that might be helpful here. Firstly, if the website is set to
production
mode, make sure you run the command to deploy the static assets as below:Second, if your site is hosting with Nginx, make sure you include the
nginx.conf.sample
file located at the Magento 2 root folder. More specifically, following is the snippet (Magento 2.3.0) which handle the static assets requests:it means your deployed_version.txt is removed kindly add it again and delopy your magento 2 it will working fine.
deployed_version.txt is exists in pub/static/