Chibimagic's Weblog

Apache + .htaccess + Mac OS X

Posted on: February 27, 2009

Argh. I just spent an hour trying to get .htaccess files working under Apache 2 + Mac OS X. Did I edit the right httpd.conf file? Is my .htaccess file named correctly? Is apache actually restarting when I tell it to? And then there was one of those duh moments, followed by an argh moment.

Of course, the file to edit under Mac OS X Leopard and its default Apache 2 is /etc/apache2/httpd.conf (/etc/httpd/httpd.conf under older versions of Mac OS X with Apache 1.3). And the section to change is:


<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>

To enable .htaccess, change AllowOverride None to AllowOverride All. But under Mac OS X, there’s a section that comes immediately afterwards: <Directory "/Library/WebServer/Documents">, and you have to change the AllowOverride None there too. Argh.

Advertisements

16 Responses to "Apache + .htaccess + Mac OS X"

thank you so much, that was really helpful

this was the lil piece I was missing! thanks!

THANK YOU THANK YOU THANK YOU! I’ve been banging my head against this for HOURS.

I have been trying to find a way to solve this problem under a Mac os.x 10.4.11 But in vain I did the changes stated in your post for older versions of mac but still I could not make it work. by the way I have installed a Mamp server in local for testing and I also did the same changes in the httpd.conf that is included in the MAMP server still no chance. And this is the error that I always get: Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2 Server at localhost Port 8888.

I hope you give a clue for this. Thank you in advance

Words cannot express how helpful you have just been.

Be careful, you have to change Users file conf,
for me, in /etc/apache2/users/myname.conf –> Alloverride was positionned to None
This is this file you have to change,

I hope thats help,
n

Thank you very, very much!
I’ve spent hours for this!

Thank you! This was driving me nuts. I needed to follow both your instructions and the ones nina posted in the comments. Would you consider updating your post to include checking the user-specific preferences in /etc/apache2/users?

Seriously, thank you for taking the time to post this.

Thanks, was really struggling to find the problem… had narrowed it down to the .htaccess not being used, then found your page!!

I did this, and for all users, and restarted apache with “sudo /usr/sbin/apachectl restart” in terminal. Still nothing!

You are the man! THANK YOU. It started to give me the headache for reading and testing all approach but this is the right one. THANK YOU.

Thanks! I was going around in circles for a few hours before I found your post :)

God bless you

I cant find my user file conf, where should it be?

Whoa thanks.
@Francisco, by OSX 10.10, it’s in /etc/apache2/users/ by default.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: