.htaccessmamp

How to get MAMP to read .htaccess files


I am trying to get the .htaccess working in MAMP. The content of the .htaccess is a simple redirect line, but the entire .htaccess file seems to have no effect, even when I change it to contain invalid data.

Is there any settings within MAMP I need to change to enable .htaccess files?


Solution

  • Go to httpd.conf on /Applications/MAMP/conf/apache and see if the LoadModule rewrite_module modules/mod_rewrite.so line is un-commented (without the # at the beginning)

    and change these from ...

    <VirtualHost *:80>
        ServerName ...
        DocumentRoot /....
    </VirtualHost>
    

    To this:

    <VirtualHost *:80>
        ServerAdmin ...
        ServerName ...
    
        DocumentRoot ...
        <Directory ...>
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory ...>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>