Getting htaccess working (for permalinks) on Mac OSX server
-
Hi all,
Sorry if this is duplicate documentation, but I don’t think this super-easy set of steps is covered here in the support forum (you admin type people are free to delete this if it’s a repeat)
Here’s how I get .htaccess mod-rewrite stuff working for a site on my Mac OSx Server (at least as of version 10.6.7)
1) create the site in your preferred manner
2) open a terminal session and CD to the site’s root directory
3) create a .htaccess file in the root (type the command “touch .htaccess” for example)
4) change the ownership of that newly-created file to _www, which is the account that the web server runs under (“chown _www .htaccess”)
5) check to make sure that “everyone” doesn’t have access to the file (I’m lazy, I use the “get Info” command from the finder to go look, and remove “everybody” access if it’s snuck in there)
6) find the .conf file for the web site (in 10.6.7 it’s in the /private/etc/apache2/sites folder). the file will *end* in your-site’s-name.conf
7) edit the “AllowOverride” parameter from “None” to “All” and save the file
8) restart the web service (which pulls all the new goodies in).
There are several things that I’ve read in other posts that I *don’t* do…
a) I don’t edit the *global* AllowOverride setting in the httpd.conf file — I like it’s very-conservative “None” setting and, since the local site’s .conf file overrides this setting it’s not necessary.
b) I don’t CHMOD the new .httpd file in the site’s root directory to 666. This makes the .htaccess file read/writable by the world which causes me gastric pain. By using the CHOWN approach, I limit read/write access to the server rather than opening it up to the world like some posts suggest.
Hope this helps
- The topic ‘Getting htaccess working (for permalinks) on Mac OSX server’ is closed to new replies.