I recently switched a Magento 2 system from serving public files out of
/path/to/magento
to serving files out of
/path/to/magento/pub
i.e. I wanted Apache to use the index.php
file in the pub
folder. However, Magento is still generating image and asset URLs with pub
in the URL
http://magento.example.com/pub/static/frontend/Magento/luma/en_US/mage/calendar.css
instead of
http://magento.example.com/static/frontend/Magento/luma/en_US/mage/calendar.css
This is happening for images, javascript, and css file.
The obvious question: Why is this happening, how can I fix it.
The less obvious question: Where does the PHP logic reside for adding pub
to asset URL so I can debug this myself.
Cache had been cleared with a
rm -rf var/generation/*
rm -rf var/cache/*