Drupal 7:使用Global redirect模块实现节点路径重定向求助
node/3691 to events/cpt_award in Drupal 7 (With Global Redirect) Hey there! As a Drupal 7 newbie, I get that figuring out redirects can feel a bit tricky at first. Since you already have the Global Redirect module installed, let's break down exactly what you need to do—plus a backup method if Global Redirect alone doesn't fit your use case.
Option 1: Use Global Redirect with Path Aliases (Recommended if events/cpt_award is the alias for node/3691)
Global Redirect works hand-in-hand with Drupal's core Path module to automatically redirect old node URLs to their clean aliases. Here's how to set it up:
Step 1: Enable the Path module (if not already active)
Go toadmin/modulesand make sure the Path module (under "Core") is checked. Save your changes if you had to enable it.Step 2: Set the path alias for node/3691
- Navigate to the edit page of node 3691:
www.sites.com/node/3691/edit - Scroll down to the Path settings section (you might need to click "Show row weights" or expand the section if it's hidden)
- In the Alias field, enter
events/cpt_award - Save the node
- Navigate to the edit page of node 3691:
Step 3: Configure Global Redirect to enforce the redirect
- Go to the Global Redirect settings page:
admin/config/search/redirect/settings - Make sure Enable Global Redirect is checked
- Check the box for Redirect node canonical URLs to their path aliases
- (Optional) If you want to ensure consistent URL formatting (like forcing www or non-www), adjust those settings here too
- Save the configuration
- Go to the Global Redirect settings page:
Now when someone visits www.sites.com/node/3691, they'll automatically be redirected to www.sites.com/events/cpt_award.
Option 2: Use the Redirect Module (If events/cpt_award is a separate page, not an alias)
If events/cpt_award isn't an alias for node 3691 but a different page entirely, Global Redirect won't handle this on its own. Instead, install the standalone Redirect module (separate from Global Redirect) and create a custom redirect rule:
Step 1: Install and enable the Redirect module
Download the Drupal 7 version of the Redirect module, upload it to yoursites/all/modulesfolder, then enable it atadmin/modules.Step 2: Create the redirect rule
- Go to
admin/config/search/redirect/add - In the Source field, enter
node/3691(leave the "Language" dropdown as "All languages" unless you need a language-specific redirect) - In the Redirect to field, select "Internal path" and enter
events/cpt_award - Choose 301 (Moved Permanently) as the redirect type (this is best for SEO and permanent redirects)
- Save the redirect rule
- Go to
That's it! This will directly send anyone accessing the old node URL to your target events page.
内容的提问来源于stack exchange,提问作者Dusan Petrovic

