Rewrite URL not working In Drupal 6 I used the following snippet of code in my .htaccess file to extract information from a non-existent URL and pass it to an existing URL in a GET form. However, it isn't rewriting the URL with my Drupal 7 installation and when I visit a URL the should be rewritten, I just get a Page Not Found error! I have cleared all caches and even tried different browsers:

# Custom Rewrite  ScriptOptions +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^home/code/([^/]+) home/software?code=$1 [L,NC,QSA]


I have placed the code just after the default handler is set.

Could anyone tell me why this code isn't working? Should I be doing this a different way in Drupal 7?

UPDATE: Please see the question I asked on Stackoverflow to get this code working with Drupal 6 - https://stackoverflow.com/questions/10765799/rewrite-a-url-to-include-get-data-with-drupal
Handling of "Clean URLs" has changed from Drupal 6 to Drupal 7 in a way that affects Apache RewriteRule.

I'm not sure if that is what has bitten you since I don't recognise home/software?code=$1 as a typical Drupal URL. But I've found that in Drupal 7 I need to rewrite to a "unclean" URL.

For instance, the following will work in Drupal 6, but not in Drupal 7:

RewriteRule ^home/code/([^/]+) home/software/node?code=$1


In Drupal 7 you must not rewrite to a clean URL destination, even if you have clean URLs enabled.  The following will work in Drupal 7:

RewriteRule ^home/code/([^/]+) ?q=home/software/node/&amp;code=$1