Thursday, September 4, 2008

How to enable .htaccess in Mac OS X 10.5 (Leopard)

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.

3 comments:

marijndepraetere said...

Thank you! Drove myself nuts, not thinking about the /users/ .conf ...

ragamufin said...

worked like a charm, thanks!

Londerson Ara├║jo said...

Man finally i can take a smyle of my face!! Tank you so much for this post!!