Yesterday I lost a lot of time trying to enable the apache .htaccess file in my macbook. So, I decided to create this post with all information necessary to do it.
- You have to edit /etc/apache2/httpd.conf and in the root directory - usually /Library/WebServer/Documents - you have to change the attribute AllowOverride from None to All. Save and close the file.
If you want to enable the .htaccess in your ~/
Sites directory, you have to follow the below tips.
- You have to edit /etc/apache2/users/{username}.conf and modify the attributes Options and AllowOverride as below:
Options Indexes Multiviews FollowSymLinks
AllowOverride All
- Save the file and restart Apache server.
So, every time that you want to use .htaccess file, you have to modify the
Options and the
AllowOverride of the directory definition of your application.