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
Add this to http-vhosts.conf file
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Don't forget to reload your apache using this commande
sudo apachectl restart
Good luck
I know this is an old thread, but this also might raise this issue:
Make sure DocumentRoot
and Directory
links to the same folder in /etc/apache2/extra/httpd-vhosts.conf
as following:
This is an innocent mistake if you copy the virtual host block from existing sites.
Cheers!
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:
<Directory "/Users/USERNAME/Sites/">
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Changing AllowOverride
to all
and then restarting the server with a quick sudo apachectl restart
enabled me to start using mod_rewrite in .htaccess
files living beneath ~/Sites
.
yosemite os x should be like this:
<VirtualHost *:80>
ServerAdmin enzo@enzolutions.com
DocumentRoot "/Users/enzo/www/drupal8"
ServerName drupal8
#ServerAlias www.dummy-host.example.com
<Directory /Users/enzo/www/drupal8>
Require all granted
Options Includes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog "/private/var/log/apache2/drupal8-error.log"
CustomLog "/private/var/log/apache2/drupal8-access.log" common
</VirtualHost>
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:
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
This overrides the default settings for any .htaccess files used at the document root
LoadModule php5_module libexec/apache2/libphp5.so
This allows URL rewrites for permalinks
Source: link
My chose
<VirtualHost *:80>
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin user@domain.ru
DocumentRoot "/Users/r00we/sites/buytocoins.ru"
ServerName site.ru
ServerAlias www.site.ru
ErrorLog "/private/var/log/apache2/myfaketestsite.com-error_log"
CustomLog "/private/var/log/apache2/myfaketestsite.com-access_log" common
</VirtualHost>