I have WordPress Permalinks enabled but forgot to enable mod_rewrite after moving this site so everything was returning a 404. Since I moved this site back to my own server I had the pleasure of enabling mod_rewrite myself. Visions of a long night danced through my head as I thought I would have to recompile Apache in the process. Luckily it turns out that mod_rewrite is compiled in the Apache 2.2 port so all you have to do is make sure it’s enabled and allow overrides and enable options for the WordPress home directory.
1) Make sure this line: LoadModule rewrite_module libexec /apache/mod_rewrite.so is present in httpd.conf by issuing the below command. As long as it returns the line you’re good to go there.
host# grep mod_rewrite /usr/local/etc/apache22/httpd.conf
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
2.) Change the directory settings in your VirtualHost statement. To use a real example, change this:
3.) Lastly restart Apache.
host# apachectl restart