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 a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.