Skip to content

About Redirects

The Redirects module enables content managers to manage Redirects, Short URLs, track 404s, and ensure all content is findable.

Sprout Redirects - Element Index Page

Redirects

Redirects allow you to forward users and search engines to the appropriate content on your site. Redirects can be managed on a per-site basis directly in the Control Panel.

The Redirects module supports 3 types of redirects:

TypeDescription
301Redirect content that has permanently moved to a new location
302Redirect content that has temporarily moved to a new location
404Captures a 404 request and allows you to manually convert the URL that is 404ing into a 301 or 302 redirect.

Redirect Settings

Each Redirect has 4 settings, tracks the count of how many times it was used, and can be enabled or disabled.

Sprout Redirects - Edit Page

SettingDescription
Old URLThe URL where your content used to live
New URLThe URL where your content will live in the future
MethodIndicate to search engines whether the redirect behavior is permanent or temporary
Match PatternsEnables additional checks to process more advanced patter matching in the redirects using regular expressions optional

Bulk Actions

Redirects can be updated via bulk actions by selecting the checkboxes next to each Redirect on the Redirect listing page. Currently supported bulk actions include:

Bulk ActionDescription
Update Status to EnabledUpdates a Redirect status to Enabled
Update Status to DisabledUpdates a Redirect status to Disabled
Update Method to 301Updates a Redirect Method to a 301 Redirect
Update Method to 302Updates a Redirect Method to a 302 Redirect
Add to Excluded URLsAdds an Old URL to the Excluded URL List
Settings->Redirects->Excluded URL Patterns

This action only appears when 404 Redirects are selected.
EditOpens a Redirect's Edit page in the Control Panel.

This action only appears when a single Redirect is selected.
DeleteDeletes a Redirect.

Pattern Matching

Redirect multiple URLs with a similar pattern by selecting the Match Patterns option. When the Match Patterns option is selected, you can then use Regular Expressions in the Old URL field and reference Capture Groups in the New Url field.

Old Url - Regular ExpressionsNew Url - Capture Groups
/old-location/(.*)new-location/$1
/old-location/(\d{4})/(\d{2})new-location/$1/$2

Order of Redirects

Redirects can be re-ordered via drag and drop when ordered by the Structure option on the Redirect listing page.

Redirects are processed from top to bottom as they are seen in the Structure view. If two or more redirects match a URL, the highest on the list will be the one that takes priority in how a particular URL is redirected.

Performance

Redirects are not processed during a request until Craft tries all other Routing options. When a page is about to 404, the Redirects module will then check to see if a URL matches a Redirect rule and route things accordingly. This takes place between step 5 and 6 of Craft's Routing rules. Waiting until the last moment allows you to optimize your website experience and page speed for the majority of your users while still helping redirect any people attempting to access old URLs to the right place.

404 Redirects

To monitor and capture 404 Redirects, you will need to enable them in your Redirect module settings: Settings-Sprout->Redirects->Log 404 Redirects.

Log 404 Redirects

404 Redirects will get created with a disabled status and a default redirect location to your home page.

404 Redirects will need to be reviewed and manually updated to choose a redirect method (301 or 302), a redirect location, and be enabled.

You can view all 404 Redirects on the Redirects tab using the filter in the sidebar for '404 - Page Not Found'.

Settings

Read the Config Settings documentation to explore and customize settings.

Updates

See update guides for the Redirects and Framework modules.

Craft The Planet