CLEAN URLs issue in Drupal
Many times we face a problem, where Drupal gives a trouble in enabling the Clean Url Feature.
Hereby, I am providing two solutions which you can try and see if it works.
Solution #1
- Make sure the rewrite module is enabled by going to /etc/apache2/mods-enabled.
If "rewrite.load" is not there you will have to add it:
$ sudo a2enmod rewrite- Disable Site default..
command: sudo a2dissite default- Edit default file as 'root' in etc and set 'All' to 'AllowOverride' for DocumentRoot /var/www
command: sudo gedit /etc/apache2/sites-available/default- Enable site default..
command: sudo a2ensite default- Restart apache
command: sudo service apache2 restart
Even after these steps, if you are facing some trouble in setting clean urls for fresh setup of drupal..try..
Solution #2:
- Add this code to /etc/apache2/httpd.conf:
# fix for clean urlsAllowOverride all
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Then save the file.- Restart Apache
$ sudo /etc/init.d/apache2 restart
OR sudo service apache2 restart
Finally, rerun your Clean URL test. You should now see a checkbox for enabling URLs. (You may have to clear your Drupal cache and Browser cache before running the test).
Feel free to post a comment if the solutios provided above still not working, would be happy to look into it further ahead and post solutions if possible.
Add new comment