Domanda

It first started after i set https://(My_Domain_Name).com into Configuration > Web > Base URLs & Base URLs (Secure) > Base URL for Static View Files & Secure Base URL for Static View Files (I'm not even sure if this is the cause). I tried several solutions including: (Solutions from similar problems in stackexchange)

1) Go to pub/static folder and remove everything, except .htaccess file. Open up app/etc/di.xml find the path Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy. (It is already set to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy by default)

2) Using Putty to run below commands

    bin/magento setup:static-content:upgrade
    bin/magento setup:static-content:deploy
    bin/magento indexer:reindex

3) Using Putty to run below commands

    php -dmemory_limit=1G bin/magento setup:upgrade
    php -dmemory_limit=1G bin/magento setup:di:compile
    php -dmemory_limit=1G bin/magento setup:static-content:deploy -f
    php bin/magento cache:clean

4) The permission for /pub/ and /var/ folders is set to 0755 as per default.

I'm using Goddy Hosting > C-Panel > Magento 2.3.1 on Windows 10. First picture is from frontend and second picture is from backend. enter image description here

enter image description here

È stato utile?

Soluzione

If you deployment script not working for you, then there is something missing in your .htaccess file.

Download same Magento version on your local system, and replace following .htaccess files

ROOT/.htaccess
ROOT/pub/.htaccess
ROOT/pub/static/.htaccess

Edit: in ROOT/.htaccess and ROOT/pub/.htaccess file add following line on top of the file:

SetEnvIf X-Forwarded-Proto https HTTPS=on

Altri suggerimenti

I too got this error many times during fresh installation, hope this answer helps you.

Try below sql commands in your db

UPDATE core_config_data SET value = 0 WHERE path = 'web/seo/use_rewrites';

INSERT INTO core_config_data (config_id, scope, scope_id, path, value) VALUES (null, 'default', 0, 'dev/static/sign', 0);

and proceed below commands from your root directory

php -dmemory_limit=1G bin/magento setup:upgrade
php -dmemory_limit=1G bin/magento setup:di:compile
php -dmemory_limit=1G bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
chmod -R 777 var/ pub/ generated/
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top