Skip to contentSkip to main navigation Skip to footer

Advanced Redirects Module

Squirrly SEO Advanced Redirects Module screen on a laptop

The Redirects module at Squirrly > Redirects sends visitors and search engines from an old URL to a new one, logs 404 errors and redirects broken URLs. It needs the Squirrly SEO Advanced Pack.

The screenshots come from demo.squirrly.co, a test store for cat food, with Squirrly SEO 14.2.10 and the Advanced Pack 2.5.12. The demo has five sample rules: three plain redirects and two regex rules.

What the Redirects module does

Each rule has a Redirect From path, a Redirect To address and a code such as 301 or 302. Squirrly also adds rules by itself when you change the slug of a post, and it can send every 404 page to one address.

Menu itemWhat you do there
RulesAdd, edit, disable, delete, filter and export redirects
LogsSee the redirects that ran and the 404 errors (shows when logging is on)
Import & DataImport redirects from other plugins, back them up and restore them
SettingsCache, hit tracking, defaults for new rules, changed paths, broken URLs, logging

Turn on Redirects

  1. Go to Squirrly > All Features and find the Redirects card.
  2. Turn it on. The Redirects item appears in the Squirrly menu.
  3. Click Squirrly > Redirects. Without the Advanced Pack, the screen shows the button Install/Activate Squirrly SEO – Advanced Pack. Click it to add the Pack.

The SEO Recommended Mode and SEO Expert Mode of the setup wizard turn Redirects on. The 404 Monitor card on the same page turns on the 404 log.

Redirects Rules

Squirrly > Redirects > Rules opens the screen called Redirects Rules, “The list of redirect and rules from Squirrly SEO.”

Squirrly SEO Redirects Rules list with five redirect rules, codes and hits
Redirects Rules on the demo site with five rules: three plain paths and two regex rules, each with its code, hits and last access.

The list of redirects

ColumnWhat it shows
URL FromThe old path that triggers the redirect
URL ToThe address the visitor lands on
CodeThe redirect type, for example 301
HitsHow many times the rule ran, while Track Redirect Hits is on
Last AccessThe date and time of the last hit

Open the three-dot menu at the end of a row to see Edit Redirect, Disable Redirect (Enable Redirect on a disabled rule) and Delete Redirect. A disabled rule stays in the list and stops running until you enable it.

Add a custom redirect

  1. Go to Squirrly > Redirects > Rules and click Add Custom Redirect. The Add New Redirect window opens.
  2. Type the old path in Redirect From, for example /old-cat-food-guide.
  3. Type the new address in Redirect To.
  4. Pick the URL Matching and the Redirect Type. Both start with the defaults from Settings.
  5. In SEO Beginner mode, turn on More Options to see Regex Match, Ignore Case and Ignore Slash.
  6. Click Add Redirect.
Squirrly SEO Add New Redirect window with a 301 redirect from /cat-feeding-guide/
A simple 301 rule on the demo site: /cat-feeding-guide/ now sends visitors to /how-many-times-a-day-should-a-cat-eat/.
OptionChoices
URL MatchingExact URL match, Ignore all query parameters, Ignore and pass all query parameters
Redirect Type301 – Moved Permanently, 302 – Found, 307 – Temporary Redirect, 308 – Permanent Redirect, 404 – Page Not Found
Regex MatchOn treats Redirect From as a regular expression
Ignore CaseOn matches the path whatever the letter case
Ignore SlashOn matches the path with or without the trailing slash

Example: redirect a whole folder with regex

One regex rule can move every URL in a folder. On the demo site the recipes moved from /recipes/ to /cat-recipes/, so this rule covers all of them:

  1. In Redirect From, type ^/recipes/(.*)$. The part in brackets catches everything after /recipes/.
  2. In Redirect To, type /cat-recipes/$1. $1 puts the caught part back.
  3. Pick 301 – Moved Permanently, turn on Regex Match and click Add Redirect.
Squirrly SEO Add New Redirect window with Regex Match on for ^/recipes/(.*)$
The regex rule on the demo site, with Regex Match on.

Now /recipes/turkey-puree-for-older-cats/ opens /cat-recipes/turkey-puree-for-older-cats/ with a 301, and the same goes for every other recipe. The demo site has a second regex rule, ^/blog/(.*)$ to /$1, that drops an old /blog/ folder from the URLs.

Leave Regex Match off unless you write regular expressions. How To Use Redirects with Regular Expression & Regex? has examples.

Edit a redirect

Click Edit Redirect on the row, change the fields and click Save Redirect. The edit window also has Redirect Order and calls the regex switch Regex Redirect Match. Saving an edit sets Hits back to 0.

Squirrly SEO redirect row menu with Edit Redirect, Disable Redirect and Delete Redirect
The three-dot menu on a rule: Edit Redirect, Disable Redirect and Delete Redirect.
Squirrly SEO Edit Redirect window with Regex Redirect Match and Redirect Order
The Edit Redirect window for the regex rule, with Redirect Order at the bottom.

Delete redirects in bulk

  1. Tick the redirects you want to remove.
  2. Pick Delete in Bulk Actions and click Apply.
  3. Confirm “Are you sure you want to delete the rules?”.

Filter and search the list

The list under Bulk Actions starts on All redirects. Pick one type to see only those rules.

FilterRules it shows
Custom RedirectsThe ones you added with Add Custom Redirect
Post RedirectsThe ones set in the 301 redirect field of a post snippet
Slug Changed RedirectsThe ones Squirrly added when a slug changed

To find one rule, type part of the path in “Write the redirect you want to search for” and click Search. Show All clears the search. The list under the table sets how many records show per page.

Export redirects to CSV

Click Export Redirects under the table to download sq_redirects.csv. The columns are source_url, target_url, action_code, ignore_case, ignore_slash and match. The export takes up to 10,000 rules and follows the type filter you picked.

Redirects Log

The Logs item shows in the Redirects menu once 404 Monitor or Log Redirects is on. The Redirects Log screen lists URL From, URL To, Code and Access for each entry.

  • Pick a code in the list at the top, for example 301 – Moved Permanently, to see only those entries.
  • Search with “Write the redirect you want to search for” and clear it with Show All.
  • Click Clear All Log and confirm “Are you sure you want to empty the log?” to empty it.
Squirrly SEO Redirects Log with redirect entries, codes and access times
The Redirects Log on the demo site, one line for each visit a rule redirected.

404 Monitor

Pick 404 – Page Not Found in the code list to see the addresses that returned a 404 and when. Add a rule for the ones that should point to a live page. The entries only start after 404 Monitor is on in Settings.

Squirrly SEO 404 Monitor list with missing URLs and access times
404 Monitor on the demo site: four addresses that returned 404. Each one is a candidate for a new rule.

Import, back up and restore redirects

Squirrly > Redirects > Import & Data opens Import & Data. With Redirects on, the Import Settings & SEO tab has Import Redirect From. With the Advanced Pack active, Export Everything and Import Everything have an Advanced Pack redirects switch.

Squirrly SEO Import Redirect From option in Import and Data
Import Redirect From on the Import Settings & SEO tab.
  1. Open Backup Settings & SEO, leave Advanced Pack redirects on and click Export Everything.
  2. Open Import Settings & SEO, pick the source in Import Redirect From and click Import Redirects.
  3. Check the new rules in Squirrly > Redirects > Rules.

The sources are Eps 301 Redirects, All In One SEO, Redirect Redirection, Redirection, Rank Math, Quick Redirects, Squirrly SEO, SEO Framework, SEO Press, Yoast SEO and WordPress Core (Slug Changes). The note says “It will overwrite the redirects you set if there are the same paths.” A good import tells you how many redirects it added. To bring the rules back, upload the file in Import Everything on the Restore Settings & SEO tab, with Advanced Pack redirects on.

Redirects Settings

Squirrly > Redirects > Settings sets how all the rules behave. Click Save Settings at the bottom after any change.

Squirrly SEO Redirects Settings with Use Redirect Cache, Track Redirect Hits and Post Types Settings
The top of Redirects Settings in SEO Beginner mode.
LabelWhat it doesDefault
Use Redirect CacheLoads redirects from cache to speed them upOff
Track Redirect HitsCounts hits and the last access, with no user informationOn
Default URL Matching (Expert)The matching new rules start withPass
Default Redirect Type (Expert)The code new rules start with301 – Moved Permanently
Default Ignore Case (Expert)New rules ignore letter caseOn
Default Ignore Slash (Expert)New rules ignore the trailing slashOn
Redirect Changed PathsPost types that get a redirect when their path changesYour choice
Redirect Broken URLsSends every not found post to one addressOff, address is the home page
404 MonitorLogs every 404 errorOff
Log RedirectsLogs every redirect that runsOff
Log HTTP Header (Expert)Saves the request headers with each log entryOn
Log daysHow long log entries are kept7 days

Use Redirect Cache

The screen says it loads redirects from cache and improves the redirect speed. It’s off by default.

Track Redirect Hits

Fills the Hits and Last Access columns of the rules list. The screen notes it contains no user information.

Default URL Matching

This Expert Mode option sets the matching that new rules start with.

ChoiceText on the screen
ExactMatches the query parameters exactly defined in your source, in any order
IgnoreAs exact, but ignores any query parameters not in your source
PassAs ignore, but also copies the query parameters to the target

Default Redirect Type

The code Squirrly puts in the header of new rules, from 301 to 404. The default is 301 – Moved Permanently.

Default Ignore Case

The screen gives the example “/Source-URL will match /source-post”. On by default.

Default Ignore Slash

The screen gives the example “/source-post/ will match /source-post”. On by default.

Post Types Settings

This block holds Redirect Changed Paths and Redirect Broken URLs. How to Redirect All 404s on Your Site explains when the second one makes sense. Squirrly saves that switch with the 404 page pattern of Automation.

Redirect Changed Paths

Pick the post types to watch in the list. When you change the path of one of them in the post editor, Squirrly adds a rule from the old path to the new one, listed under Slug Changed Redirects. The demo watches Post, Page, Attachment and Product.

Squirrly SEO Redirects Settings Logging section with 404 Monitor, Log Redirects and Log days
The Logging block on the demo site with 404 Monitor, Log Redirects and Log HTTP Header on, and logs kept for 7 days.

Log Redirects

Keeps a log with all the redirects. The entries show in Redirects Log.

Log HTTP Header

An Expert Mode switch that saves the HTTP headers with each entry, except cookies. The screen warns they may include user information and make the log bigger.

Log days

Choose 1, 7, 30, 60, 90 or 365 days. A daily WordPress cron job deletes older entries.

Before you change redirects

  • Turning off both 404 Monitor and Log Redirects deletes the log table, with every entry in it.
  • Make a backup with Export Everything (Advanced Pack redirects on) before an import, because imported rules replace rules with the same path.
  • Editing a rule sets its Hits back to 0.

Troubleshooting

“Cron is disabled in config with DISABLE_WP_CRON declaration. Make sure the cron is working and the log is cleared.”

The log can’t clear itself while WordPress cron is off. Run cron from the server, or clear the log by hand with Clear All Log.

“No redirects found to import.”

The plugin you picked has no redirects in this database. Pick another source in Import Redirect From.

The Redirects menu is missing

Turn on the Redirects card in Squirrly > All Features and check that the Advanced Pack is active.

The Logs item is missing

Turn on 404 Monitor or Log Redirects in Squirrly > Redirects > Settings.

Frequently asked questions

Do I need the Advanced Pack for redirects?

Yes, Squirrly > Redirects shows the Install/Activate Squirrly SEO – Advanced Pack button until the Pack is active.

Does Squirrly redirect a post when I change its slug?

Yes, for the post types picked in Redirect Changed Paths.

Can I move my redirects from Redirection or Rank Math?

Yes, pick the plugin in Import Redirect From and click Import Redirects.

How long does Squirrly keep the logs?

7 days by default, and up to 365 days with Log days.

Was This Article Helpful?

Before you leave

Future of AEO GEO and AI Search!

Free Now. Free Forever.

It’s time to stop orbiting SaaS.

Be the Meteor.

10 Elite Tools. 1 Stack.