0
votes

I'm looking to 301 redirect an URL from a old version of a site no longer being used to a new URL that has been created in fresh Drupal installation.

Old URL: /198/our-software/

New URL: /services/software-development/

In the .htaccess located in the root directory of Drupal I have added the following:

redirect 301 /198/our-software/ http://www.domain.com/services/software-development

The redirect is working to some extent, it sends the user to a url like below with a query string appended to the end of it, which results in a 404 error:

http://www.domain.com/services/software-development?q=198/our-software/

I have tried placing the redirect at both the start and end of the .htaccess file both result in a 404 page not found error.

Do I need to use a more complex redirect to get around Drupals URL rewrite?

NOTE: I'm using the Pathauto module.

2

2 Answers

2
votes

Rather than edit the .htaccess directly, just install the Path Redirect module which has that exact functionality built in.

Note that the Path Redirect module is only available for Drupal 6 (as of 2/22/12)

0
votes

I got it working with using "RewriteRule" instead, AND (important!) removing the leading slash in the source URL, so in your case:

RewriteRule 198/our-software/ http://www.domain.com/services/software-development [R=301,L]