CSS and JS not loading after installation of Magento default template


Why this issue Occur

If you redeployed  it after deleting the pub/static directory you would have deleted the .htaccess file in pub/static directory in your best website hosting services. That causes the URL Rewrite issue.

 

Put the .htaccess with url rewrite option in the pub/static directory , will resolve the problem






How to fix this issue.

 

  • Kindly Login cPanel

 

  • /home/public_html/pub/static

 

 

  • Go to app/etc/di.xml

 

  • Replace ('Symlink' --> 'Copy')

 

  • Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

        to

  • Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

 

  • Save it