Clean URLS/.htaccess

.htaccessclean-urlsdrupal-7

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

Looking for feedback

Goal: I am trying to enable "Clean URLs" on a Drupal 7 site (such that example.com/?q=user resolves to example.com/user).

I've just spent way too long pouring through official Drupal docs and comments, to no avail, so any suggestions are greatly appreciated!

I have checked the box "Enable Clean URLs" in Drupal (/admin/config/search/clean-urls) and got the all-clear that the configuration options were saved. So now I am actually able to go to example.com/user and it does indeed display the same content as example.com/?q=user. What I want, however, is for example.com/?q=user to be rewritten in the URI as example.com/user.

The relevant .htaccess code is shown above, and my Apache conf appears to be properly configured.

Best Solution

Clean urls do indeed work but I kept getting errors until I found this This saved my sanity:

  • disable Overlay module
  • go to Clean URLS
  • change URL from: /?q=admin/config/search/clean-urls
  • to: /admin/config/search/clean-urls
  • Then the Check box should appear
Related Question