Sunday, March 23, 2008

Enable .htaccess in Leopard

By default, in Leopard Apache, you can't use the .htaccess files.

The solution is to edit your .conf file and modify 2 lines:

-> Open Terminal App
-> Write "sudo pico /private/etc/apache2/httpd.conf"
-> Press ctrl + w
-> Type "AllowOverride" and press enter
-> Replace "AllowOverride none" for "AllowOverride All"
-> Press againg ctrl + w and then enter
-> Replace again "AllowOverride none" for "AllowOverride All"
-> Press ctrl + x
-> Type 'y'
-> Press enter
-> Type "apachectl graceful" and press enter
And it's done, you can close the Terminal and start using .htaccess files

4 comments:

Lane said...

I need your help!

I just went through and changed my Apache server settings as described above, but when I performed the last command – 'apachectl graceful' – I got the error message:

CFURLWriteDataAndPropertiesToResource(/System/Library/LaunchDaemons/org.apache.httpd.plist) failed: -10

Alas, .htaccess still doesn't work for me.

Usenet said...

Hi Lane, I had the same error message (failed -10) using the apachectl graceful command.
But just ignore it. And to restart the web server, use instead the System Preferences panel, and the Shared Web Server (Sharing tab).
If you actually change and made no mistake in httpd.conf, it will work !!

Guy said...

The last command should read:

-> Type "sudo apachectl graceful" and press enter

brinkka said...

I recently came across your blog and have been reading along. I think I will leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
By : http://www.factspenisenlargement.com