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.

Author: Danyal
I'm skilled programmer with expertise in Vue.js/Nux.js for front-end development and PHP Laravel for back-end development. I excel in building APIs and services, and also have experience in web server setup & maintenance. My versatile skill set allows you to develop and maintain web applications effectively, from the user interface to the server-side functionality. I love coding with never ending learning attitude, thanks for visiting danya.dk