Magento 2 Apache Rewrites Not Working Locally – Troubleshooting Guide

magento2url-rewrite

I have a new local version of Magento2 and it all works and installs correctly.

The only thing that isn't working is the URL rewrites. I have an htaccess file in the root of the site.

Apache 2.4 – attached is my vhost file. (Maybe I need something else here?)

Mac El Capitan

<VirtualHost *:80>
        DocumentRoot /Users/brent/Sites/magento2/
        ServerName magento2.super-awesome-test.com
        <Directory  /Users/brent/Sites/magento2>
        Require all granted
        Options Includes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
        </Directory>
        ErrorLog /Users/brent/Sites/magento2/logs/mage2-error.log
        CustomLog /Users/brent/Sites/magento2/logs/mage2-access.log common
</VirtualHost>

Best Answer

The problem was when I upgraded to El Capitan it overwrote my existing httpd.conf file and the mod_rewrite was commented out.

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

I uncommented it and Mod_Rewrite works!

Related Topic