Enabling Clean URLs for Drupal in Ubuntu 14.04 LTS

Drupal is awesome, but without clean URLs it can make site configuration and menu setup exceedingly annoying.

In the newer versions of Ubuntu, the Apache config has changed just enough to make me re-do a bunch of stuff when setting up a new Drupal install. Here is the way I was able to enable Clean URLs from a base Ubuntu 14.04 LTS LAMP install:

  • Enable mod_rewrite for Apache

    # a2enmod rewrite
  • Add AllowOverride within the default website configuration

    # nano /etc/apache2/sites-available/000-default.conf

    Add just under DocumentRoot /var/www/html

    <Directory /var/www/html>
    AllowOverride All
    Order Allow,Deny
    Allow from all

  • Make sure .htaccess is in the default web directory!

    # ls /var/www/html/.htaccess

    If nothing shows after using the above command, download Drupal again and copy the .htaccess file to that directory
  • Share this