Enable Clean URL's for Drupal on Debian 7 (Wheezy)

To enable Drupal Clean URL’s on a host running Debian 7 (Wheezy), two following steps will be required in order use the core Drupal URL Aliases module. First you will need to enable the apache rewrite module, once enabled you will then need to update the virtual host file to allow for overrides. Once these steps have been completed, you will then need to either restart or reload Apache.

Enabled Apache Rewrite

$ sudo a2enmod rewrite

Edit virtual host file, allowing all overrides

$ sudo nano /etc/apache2/sites-available/default

Update the first two instances of “AllowOverride None” to “AllowOverride All”, the updated file should appear as:

<VirtualHost *:80>
       ServerAdmin webmaster@localhost
       DocumentRoot /var/www
       <Directory />
               Options FollowSymLinks
               AllowOverride All
       </Directory>

       <Directory /var/www/>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       </Directory>

       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
       <Directory "/usr/lib/cgi-bin">
               AllowOverride None
               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
               Order allow,deny
               Allow from all
       </Directory>

       ErrorLog ${APACHE_LOG_DIR}/error.log

       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel warn

       CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save the file, and restart Apache

$ sudo service apache2 restart

About the author

Will works as a technical lead for Kanopi Studios and provides Drupal support for a wide range of amazing projects. He current resides in South Carolina along with his wife, son and two dogs. When not working on tech projects, Will enjoys spending time with family and photographing the stars.