1
<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.

4

3 回答 3

5

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
于 2012-03-15T19:27:27.620 回答
2

I was searching for this issue, the solution that work for me was that:

  1. Left click on the wamp server icon and go to the apache.
  2. Here sub menu will be opened, go to the apache modules and enable the rewrite_module.
  3. now restart wamp server and then check your site.
  4. Enable clean url will now be active.
于 2012-12-27T08:09:37.317 回答
0

there should be a closing bracket on your last line "]". Perhaps this is the source of your frustration?

于 2012-10-15T17:50:33.943 回答