Apache 2.4.6 default.conf format changed. Unable to run .htaccess Apache 2.4.6 default.conf format changed. Unable to run .htaccess codeigniter codeigniter

Apache 2.4.6 default.conf format changed. Unable to run .htaccess


I'm still a new to server/command line land, so I thought I'd append a step by step solution for others in a similar place. Hope this helps someone out:

  1. Login to your server.

  2. Open the 000-default.config file with nano:

    $ sudo nano /etc/apache2/sites-available/000-default.conf
  3. Look for this line within VirtualHost: DocumentRoot /var/www/html and add the following just underneath it:

    <Directory /var/www >    AllowOverride All</Directory> 
  4. Save your edits:Press CTRL + O to Writeout; then hit RETURN to save your changes

  5. Exit Nano:Press CTRL + X

  6. Restart your server:

    $ sudo service apache2 restart
  7. If you need to activate the apache mod_rewrite module, run this command:

    $ sudo a2enmod rewrite 

    And if the module is already activated, you'll get a message letting you know all is well.


This is a bit old, but since I'm seeing it now and I got it to work, maybe this will clarify for anyone stumbling on it.

You open up that 000-default.conf file and find where it says "/var/www" then put this in:

<Directory /var/www>AllowOverride All</Directory>

Then just save and restart apache. You also need to have mod_rewrite turned on for Apache. That's easy to find by Googling.


ServerName localhostServerAdmin webmaster@localhostDocumentRoot /var/www     <Directory /var/www >            AllowOverride All    </Directory>ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined

;)