Step by Step guide to installing the Drupal module Global Redirect

Global Redirect is a simple but incredibly useful module for SEO that makes sure users are going to the correct alias of a node since nodes can be aliased in multiple ways (clean url, unclean url, node/###) and duplicate content is a no-no in the SEO world. From the module page:

  1. Checks the current URL for an alias and does a 301 redirect to it if it is not being used.
  2. Checks the current URL for a trailing slash, removes it if present and repeats check 1 with the new request.
  3. Checks if the current URL is the same as the site_frontpage and redirects to the frontpage if there is a match.
  4. Checks if the Clean URLs feature is enabled and then checks the current URL is being accessed using the clean method rather than the ‘unclean’ method. (Currently only in DEV, will be in 1.3)

The steps to get Global Redirect working are simple.

  1. Download the module and unzip the file into your /sites/all/modules or /sites/{yoursitename}/modules.
  2. Log into your drupal site with an account that has access to add modules.
  3. Go to Administer -> Modules (or just type in the url of admin/build/modules)
  4. Scroll down to the “Other” section and click on the “Enabled” checkbox next to Global Redirect.
  5. Click on Save Configuration
  6. If you already have the path module enabled you won’t see the following message. If you don’t have it enabled you’ll see a second page that ass if you would like to enable the path module. We do so hit the continue button.
  7. If instalation was sucessful you should see no errors and you’ll be redirected back to the module page.8. Global Redirect does not have anything to configure so there will be no additional links you need to click on.

To test if global redirect is working:

  1. Make sure your logged in as someone who can create nodes
  2. Create a node (Create Content) and give it an alias (it doesn’t matter what type of node it is page, story, whatever)
  3. Fill out the title and the body.
  4. Make sure you click on “URL path settings” and give the node a path. For this example I’m going to call mine “global_redirect_test”.
  5. Click on Submit
  6. Mouse over the edit button on the node you just created.
  7. In the status bar you’ll see something like “http://{your domain name}/?q=node/1/edit” or “http://{your domain name}/node/1/edit”. The number after node is the Node ID.
  8. Now go up to the address bar and type in “http://{your domain name}/node/{your node id number found in step 6}” or “http://{your domain name}/?q=node/{your node id number found in step 6}”
  9. If global redirect is working the address bar URL should change to “http://{your domain name}/global_redirect_test” or “http://{your domain name}/?q=global_redirect_test”
  10. If global redirect is not working the address bar will just stay as “http://{your domain name}/node/{your node id number found in step 6}” or “http://{your domain name}/?q=node/{your node id number found in step 6}”

A quick note about caching & Global Redirect. Since Global Redirect needs to be loaded on every page load the maximum setting you can have for caching in the performance section (admin/settings/performance) is Normal. If your Caching mode is set to “Aggressive” Global Redirect will not work.