Categories


Archives


Recent Posts


Categories


Magento 2: Multiple .htaccess Files

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

The current Magento 2 source code has a number of different .htaccess files

./.htaccess
./app/.htaccess
./dev/.htaccess
./downloader/.htaccess
./downloader/template/.htaccess
./lib/.htaccess
./pub/.htaccess
./pub/errors/.htaccess
./pub/lib/.htaccess
./pub/media/.htaccess
./pub/media/customer/.htaccess
./pub/media/downloadable/.htaccess
./pub/media/theme_customization/.htaccess
./pub/static/.htaccess
./var/.htaccess

If you do a lot of development with symlinks, you’ll want to watch out for the following

#File: ./pub/static/.htaccess
Options None
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>
<IfModule mod_rewrite.c>
    RewriteEngine Off
</IfModule>

That first line (Options None) will disable Apache’s ability to serve symlinks out of your static folder.

I totally didn’t spend an hour debugging my http.conf files because of this.

Copyright © Alan Storm 1975 – 2019 All Rights Reserved

Originally Posted: 20th August 2013