2

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/*

1 Answer 1

5

Turns out the caches weren't entirely cleared. The system was running with the default full page caching enabled, and I had failed to clear the var/page_cache folder.

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.