I accidentally deleted my .htaccess file. Before that I could just delete everything in the
pub/static folder (except the
.htaccess file of course) and just reload the page to see my CSS / LESS changes. Without the
.htaccess file the stylings completely disappear. Now I always have to run the
bin/magento setup:static-content:deploy command in order to see my changes which takes for ever. Is there any way I can re-setup the
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
You can download corresponding file from the official Magento 2 repository. That will solve your problem.
You can find the .htaccess file from below path :
Hope it may help you!
- You can find the
- There is one more
.htaccessfile you can find in
root/directory named as
Get the file into your root directory.
Remove the cache and try.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0