Drupal7 Clean URLs

If you are runing drupal7 site on shared hosting with apache2, you definitely don’t have access to the apache2 config files.

And that will cause problem activating Clean URLs, but this can be solved by adding rewrite in .htaccess in your site’s root path.

Add following rewrite for your website:

# RewriteRule ^ index.php [L]
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Once .htaccess is updated, go to (Home » Administration » Configuration » Search and metadata » Clean URLs) you should have checkbox with “Enable clean URLs” check it and save. Clean URLs are now active.

About the author

Danyal Ali Butt

View all posts