Drupal doesn’t create clean links – checkbox doesn’t do anything After migrating my Drupal 7.27 site to a new server, I can’t get Drupal to re-enable Clean URLs.

The .htaccess file works and I can access clean URLS, but Drupal doesn’t create clean links. (For example, /admin/config/search/clean-urls works fine, but the link in Drupal points to /?q=admin/config/search/clean-urls.)

The clean URLs configuration page doesn’t say anything about the test, but offers me the option to enable clean URLs:



When I do that, it says the configuration options have been saved, but the checkbox is still unticked:



I also manually changed the settings.php to include $GLOBALS['conf']['clean_url'] = 1; but that doesn’t help either.

Does anyone have any ideas why this is happening and how I could get Clean URLs to work properly?
1)enable rewrite module on apache.

a2enmod rewrite

(to disable type a2dismod rewrite)

2)Set directory permission.
You must find the file that sets permission of each directory for apache. In my case it was /etc/apache2/sites-enabled/000-default
edit the page so that the directory that you will be using to serve webpages has "AllowOverride All". My file contains the following:

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all

3)Just restart apache and it should be working:
/etc/init.d/apache2 restart

There are several other checkpoints to fix this issue. All the points are discussed here