Drupal 301 Redirect

This weekend while working on one of my drupal sites – yeah I’m new to it and still learning just how to manipulate this content management system.

I needed to find out how to do a 301 redirect, a quick search on google turned up quite a few search results. As I went through them, I really became frustrated most of the advice and examples had me doing a 301 redirect by typing in code into the .htaccess file.

While no stranger to working with this file I could just not get the examples to work as desired. Other methods suggested creating 301 redirects for drupal by creating individual 301 headers.

I really felt there just had to be a much easier way. After hours of frustration and still more searching, I found just what I was looking for even though it was still in the development stage for Drupal 6.

The module is called Path Redirect twenty minutes later I was in business, task completed. Hopefully you’ll find this post and it will provide the answer your looking for.

Glenn Burks

Comments on this entry are closed.

  • Anonymous Jul 1, 2008 @ 22:31

    i am a serious noob but could you explain or direct me to a very direct explaination of how to install a module?

    This Path redirect looks like what I need.

    Phil
    philmiller278 @ gmail . com

    • Glenn Jul 3, 2008 @ 11:40

      Installing a module is just a matter of uploading the it to the modules folder. Then activating the module found under > Site Building > Modules. You want to make sure that you get the version that is right for your version of Drupal.

      I am still learning just how to work within this CMS version with a lot of trial and error along the way. Still I like what I’m finding.

      The 301 redirect was needed for another site that I’ve built and really wanted to change the linking structure to both make it shorter and more eye appealing as well.

      The challenge in finding the information is in asking the search engines the right questions. But expect to find generally older information that no longer may apply.

  • Anonymous Dec 10, 2008 @ 1:17

    Why not use Domain redirect from Cpanel? That’s much simpler.

    • Glenn Dec 10, 2008 @ 7:18

      That would be another option if you where using Cpanel. With a module it does not matter what hosting platform your using.

  • kenji Jul 6, 2009 @ 10:27

    PHP code does not work when your node or page has been cached by Drupal. When the page has been cached it is not able to run the php code anymore.

  • jlx Nov 3, 2009 @ 0:42

    Well, what actually gets cached in this case is an HTTP response with the redirect, so I don’t see that as a problem here..

  • Business Web Coach Jan 17, 2010 @ 9:19

    I was wondering how to handle all of the 301s because I am migrating a very old site to Drupal, and there are going to be a vast number of URL changes.

    It looks like the Path Redirect module is still in beta, so I’m still not sure if I’m going to use it just yet.

    BTW – This is an awesome source of Drupal info, I’m subscribing to your feed.