How to enable mod_rewrite Module on Ubuntu in Apache for Drupal

This will guide you to enable mod_rewrite module on Ubuntu. With this you will be able to solve clean URLs problem of Drupal.

To enable clean, go to http://localhost/yourDrupalProject/?q=admin/config/search/clean-urls.
Take clean URL test, if it fails then follow these instruction,
 
    1. Open  terminal and typin "a2enmod rewrite" , It will enable your mod_rewrite module for Apache.
    2. Then go to "/etc/apache2/sites-available" and edit default file.(For this you must have writable permissions to this file and sites-available folder.)
    3. Replace below with existing lines 4 to 14 
      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>
    4. Now restart your apache by /etc/init.d/apache2 restart Or service apache2 restart
    5. Take clean URL test again and this time it will be passed.
 
 
Author
No comments available.