301 Redirects
10-30 minIntermediate
Managing 301 redirects in Drupal is best done via the core 'Redirect' module, which handles URL aliasing overlaps automatically.
Prerequisites
- Redirect Module Installed
Easy Recommended
Using Redirect Module
The standard Drupal way for URL redirections.
1
Install & Enable
1
Ensure 'Redirect' module is enabled (usually Core or Contrib).
2
If missing: composer require drupal/redirect.
2
Add Redirect
1
Go to Configuration > Search and Metadata > URL Redirects.
2
Click '+ Add redirect'.
3
Path: The old path (e.g. /old-page).
4
To: The new path (e.g. /node/123 or /new-page).
5
Code: 301 Moved Permanently.
6
Save.
Best Practices
Do
- Use the Redirect module for content changes
- Enable 'Global Redirect' settings to fix trailing slash issues
Don't
- Create infinite loops (A > B > A)
Verification Checklist
- Visit the old URL, ensure it goes to new URL with 301 status
Pro Tips
- Enable 'Route 404 to Homepage' only cautiously; better to let 404s happen or redirect to relevant pages.