I getting started with zend framework 2 and they have a prerequisite of an installation and configuration of mod_rewrite for apache. Apache 2.2.22 came pre-installed on Mac OS X 10.8.2. Is there an easy way to install and configure mod_rewrite for apache?
The only help I have come across suggests to recompile apache. Is this the only way?
If you are serving your site from
~/Sites
, the trick for me was modifying my/private/etc/apache2/users/USERNAME.conf
file. Initially, the content was:Changing
AllowOverride
toall
and then restarting the server with a quicksudo apachectl restart
enabled me to start using mod_rewrite in.htaccess
files living beneath~/Sites
.Rob Allen's answer sounds right, but I've never used the default installation of Apache on my Mac so I can't verify. I would recommend either MAMP or Zend Server CE.
It took me a little while to get Zend Server CE configured and running correctly on my Mac, but that was version 4 and it was buggy and either way it was well worth it. Conversely, version 5.6 of ZSCE seems to be much better!
Some notes on Zend Server CE for Mac OS X
If you go with MAMP, it should be a very quick install, aside from configuring virtual hosts.
Note that both of these come with mod_rewrite already installed.
yosemite os x should be like this:
gotten from this blog post
In addition to Rob Allen's response, both line numbers are located around 168 and 169 (to save you some time from scrolling the 500+ lines of text). Also, to explain what each line does exactly:
Source: link
Add this to http-vhosts.conf file
Don't forget to reload your apache using this commande
Good luck
My chose