I have a custom CSS file created and loaded through code. The compile less option is set to yes in configuration settings. When I clear the static content flush from cache management in admin panel and reload frontend, it gives an error that the CSS file not found pub/static/frontend/vendor/modulename/en_US/css/test.css. But when I run command php bin/magento setup:static-content:deploy my test.css file is loaded. I have my apache run through user test and Magento ownership is also test. How to fix this issue?

2 Answers 2


Check you magento site mode is development then

File Path : pub/static/.htaccess

  RewriteRule .* ../static.php?resource=$0 [L] 

This code is automatically copied the files


Did you try clear pub/static folder exept .htaccess ? Then setup:static-content:deploy

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.