Drupal 7 .htaccess redirects I'm trying to redirect some old urls to the new Drupal ones with .htaccess rules.

This works

Redirect 301 /oldurl http://mysite.com/new-url


But this gives me a Drupal error

Redirect /people/details.aspx?id=1234 http://mysite.com/name-surname


Is it possible to perform a redirect like this?

The errors I get are

Warning: array_flip() expects parameter 1 to be array, string given in DrupalDefaultEntityController-&gt;load() (line 178 of /var/www/includes/entity.inc).

Warning: Invalid argument supplied for foreach() in DatabaseCondition-&gt;compile() (line 1854 of /var/www/includes/database/query.inc).

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 2: SELECT revision.vid AS vid, base.uid AS uid, revision.title AS title, revision.log AS log, revision.status AS status, revision.comment AS comment, revision.promote AS promote, revision.sticky AS sticky, base.nid AS nid, base.type AS type, base.language AS language, base.created AS created, base.changed AS changed, base.tnid AS tnid, base.translate AS translate, revision.timestamp AS revision_timestamp, revision.uid AS revision_uid FROM {node} base INNER JOIN {node_revision} revision ON revision.vid = base.vid WHERE (base.nid IN ()) ; Array ( ) in DrupalDefaultEntityController-&gt;load() (line 196 of /var/www/includes/entity.inc).


My new rules begin before the Drupal rules of

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]


As suggested I have tried redirecting to non clean URLS. This works

Redirect 301 /oldurl http://mysite.com/?q=new-url

But the URL stays as that which isn't any good as there will then be duplicate URLs of http://mysite.com/?q=new-url http://mysite.com/new-url

I tried

Redirect 301 /people/details.aspx?id=1234 http://mysite.com/?q=name-surname

But I still get the same errors as before
I've experienced that in Drupal 7 you must not rewrite to a clean URL destination, even if you have clean URLs enabled.

(This is possibly a duplicate of: Rewrite URL not working.)