Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What would the best way to setup (configure) URLs used in previous versions of a site after a site is converted to a new Drupal site?

share|improve this question

migrated from Feb 24 '11 at 8:25

This question came from our site for professional and enthusiast programmers.

Shouldn't this rather be moved to ? – EricSchaefer Apr 19 '11 at 16:12

3 Answers 3

You want to consider using the path module.

If your old site followed a fixed scheme and you have a lot of urls, you might also be able to leverage the pathauto module. Here is a quote about it (from its project page):

... creates automatic path aliases for content, users, and taxonomy terms, eliminating the need to create them manually. This way, your site is more user and search engine friendly, and more descriptive about its content with less work from your side.

share|improve this answer

The best way is to write your own import module which uses path_set_alias() to assure that the url of the page on the new site is the same as that on the old site. You can use Drupal's batch operations API to do this for you. This gives you more flexibility than simply using pathauto.

If you aren't able to do this, try to approximate your old site's urls with pathauto. Note that when you import, the paths probably won't be set with pathauto - you will need to go to the pathauto interface in order to generate these url aliases (they are called url aliases, since Drupal itself makes urls in a different way - but allows you to add url's to a page by means of these aliases).

If you're doing this for SEO reasons, you'll also want to find a way to add the canonical metatag for pages which aren't aliased, to prevent yourself from getting a duplicate content penalty. Implementing this will probably vary, depending on whether you're using Drupal 6 or 7. It seems that the nodewords module has this functionality for D6 - just a suggestion, as I haven't used it.

share|improve this answer

IMHO the answer to this question cannot be solved by either path (core module) or pathauto (contrib module), as suggested in one of the other answers. Because those modules serve another purpose.

However, a possible solution for addressing the issue as described in the question, is to use the Path Redirect module instead. Here is a quote about it (from its project page):

... allows you to specify a redirect from one path to another path or an external URL, using any HTTP redirect status.

The Path Redirect project page also includes some suggestions for related modules to be considered (which however serve another purpose related to paths).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.