0

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:

dev.ndspro.com/static/version1525430192/frontend/Nds/default/en_US/images/stories/landingpage/pdf/EZflow_Manual_Web.pdf

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}

1 Answer 1

0

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

4
  • is it good to make changes to di.xml directly..? Commented Oct 27, 2018 at 11:13
  • Yes, there is no problem for that, you can if you want do some backup before update it
    – PЯINCƎ
    Commented Oct 27, 2018 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. Commented Oct 29, 2018 at 7:36
  • can you please suggest. Commented Oct 29, 2018 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.