I am having problem with my setup in local and live, when I try to hit a url that dd not exist in : pub/static/frontend/XXX/default/ folder it gives me apache 404 error. I have my alias or domain pointing to pub folder and my htaccess are fine.

I tried to hit this URL:


Unable to resolve the source file for 'frontend/Nds/default/en_US/images/stories/landingpage/pdf/EZflow_Manual_Web.pdf'
#0 /home/devnds/public_html/releases/20181026112235/vendor/magento/framework/App/StaticResource.php(121): Magento\Framework\View\Asset\File->getSourceFile()
#1 /home/devnds/public_html/releases/20181026112235/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\StaticResource->launch()
#2 /home/devnds/public_html/releases/20181026112235/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#3 {main}

Magento 2 try to create symlinks for some static resources when you are not in production mode. You can change that behavior like this:

  • In app/etc/di.xml, section : name="view_preprocessed", replace : Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink with : Magento\Framework\App\View\Asset\MaterializationStrategy\Copy.

  • Remove the content of the bellow folders except .htaccess

    var/view_preprocessed, pub/static, generated

  • Run :

    php bin/magento c:c, php bin/magento c:f, php bin/magento setup:static-content:deploy -f

  • is it good to make changes to di.xml directly..? Oct 27 '18 at 11:13
  • Yes, there is no problem for that, you can if you want do some backup before update it
    – Aamir
    Oct 27 '18 at 11:15
  • it didn't solve the problem with domain pointing to pub file its working root folder. Can you suggest anything for pub folder. Oct 29 '18 at 7:36
  • can you please suggest. Oct 29 '18 at 7:56

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .