All 18 Redirects sections

See every section

Coming from another redirect plugin

Updated Redirects 1.8.1Tested with WordPress 7.1

Settings → Redirects from Other Plugins looks in this site's database for the redirects kept by Redirection, Rank Math, Yoast SEO Premium and Safe Redirect Manager. It finds them by their data rather than by whether the plugin is switched on, so one you deactivated last week is still found. Each one is listed with how many redirects it holds, and nothing happens until you ask.

Preview shows what an import would do before anything is written: how many redirects will come across, the first twenty as they will arrive, which old addresses already have a redirect here, and everything that stays behind, with the reason and a few examples of each. Import under it brings them over. On a long list the button works through them 500 at a time and says how far it has got, so keep the page open until it finishes. Pressing it again later is safe: what already came across is passed over. Each redirect arrives marked Imported in the list.

What comes across:

  • A redirect from one address to another, as 301, 302 or 307, and a 410 for a page that is gone. A 308 arrives as a 301, which browsers and search engines treat the same way, and the preview says how many.
  • A Rank Math Starts With rule that ends in a slash, such as shop/, as the section rule /shop/*, sending /shop and everything under it to its one destination. This is narrower than Rank Math: it takes the slash off before comparing, so its shop/ also caught /shopping and /shop-sale, and those no longer redirect once Rank Math's redirects are off. The preview counts these rules and says so. If you need such an address, add it as a redirect of its own.
  • A Safe Redirect Manager wildcard such as /shop/ the same way, and a destination ending in still carries the rest of the address along.
  • A Rank Math redirect with several old addresses as one redirect here for each. The count on the list is Rank Math's, and the preview says how many had more than one.
  • On a site in a folder (example.com/shop, or a site of a network in folders), a Yoast SEO Premium destination kept with the folder in front, as Yoast keeps one typed as a whole address or made when a post is renamed, arrives with the folder once: /shop/new-page, not /shop/shop/new-page. Redirects imported from Yoast before this was fixed still have the folder twice, and importing again leaves them as they are (they are already here). Delete those redirects under Redirects and import again.

What stays behind, each with its reason on the preview:

  • A regular expression: Redirection's regex rules, Rank Math's "regex" and Yoast's regex list. This plugin does not run them.
  • A rule only for some visitors: Redirection's rules for signed-in visitors, a role, a referrer, a browser, a cookie, an IP address, a server, a language or 404s only.
  • A rule matching part of an address: Rank Math's "contains" and "ends with", and a "starts with" rule or a wildcard that stops in the middle of a word (/blog* there also caught /blogging, which a star here never does).
  • A redirect answering with a code this plugin does not send, such as 451, 303 or 404, and Redirection's random page and pass-through actions.
  • A rule for one query string, such as /page?id=5, unless Treat anything after the ? as part of the address is on. Without it the rule would catch every visit to /page, which is probably a page that is still there.
  • A redirect switched off in the other plugin. It is counted apart from the rest, since the owner had switched it off. In Redirection that is the redirect's own switch, which is the one Redirection itself goes by: switching a group off switches its redirects off, but one you switched back on inside that group is still served there, so it comes across too.
  • The same old address twice in the other plugin's list. The first comes across; the second stays behind, since an address has one redirect here. For Redirection, first is the order Redirection tries them in: the lower position number, or the older of two with the same number. If the one it tries first cannot come across itself, for example because it is only for signed-in visitors, it is listed with that reason and the other one comes across.
  • An old address stored as a whole address with https:// in front, which these plugins do not write for their own redirects.
  • An old address that already has a redirect here. Yours is left exactly as it is. This differs from importing a spreadsheet, where a row replaces the redirect for its address: one press of a button should not write over redirects you made here.

What it does not do:

  • It never changes, switches off or deletes anything in the other plugin. Once you have looked over the redirects here, switch the other plugin's redirects off yourself: Rank Math's Redirections module, or deactivate Redirection or Safe Redirect Manager, or remove the redirects in Yoast SEO Premium. While another of these is switched on and redirecting, the Dashboard says so, with a button to its preview. Two plugins answering the same old address is how a redirect ends up somewhere nobody expected. If you keep that plugin's redirects switched on deliberately (Yoast SEO Premium has no switch for them, and makes one whenever a slug changes), press Dismiss on the note. It stays dismissed for that plugin on this site.
  • The other plugin's logs and hit counts are not read. Counting starts afresh here.
  • One import brings at most 20,000 redirects. Press it again for the rest.
  • The page caches this plugin knows are emptied once when an import finishes, not after every 500. An import stopped part way empties them at the end of the next one you finish.

A pasted .htaccess or Nginx list#

Rank Math's free version exports its redirects only as .htaccess or Nginx rules, and some sites keep theirs in the web server's own configuration. Paste the lines into Settings → Server Redirect Rules and press Preview.

These lines are read:

LineBecomes
Redirect 301 /old /new, RedirectPermanent, RedirectTemp, Redirect gone /olda redirect for /old. A Redirect with no code is a 302, as Apache treats it
RewriteRule ^old/?$ /new [R=301,L], or - [G] for gonea redirect for /old, or a 410
rewrite ^/old/?$ /new permanent;a redirect for /old
location = /old { return 301 /new; }, on one line or severala redirect for /old
a pattern that stops at a slash with no $, such as RewriteRule ^shop/ /store [R=301,L], or a Redirect for a path ending in a slashthe section /shop/*

Every other line is listed with its line number and left alone: RedirectMatch, anything with a captured group such as $1, a RewriteRule under a RewriteCond, after a rule chained with [C] or within reach of an [S=n] (each fires only some of the time), a RewriteRule after RewriteEngine Off, an internal rewrite (last, or a RewriteRule with no R), and any location that is not location =.

Every line that is not read is counted, however many there are. Preview lists the first 50 with their line numbers and says how many more there are, and wp trrd import --htaccess lists the first 200 the same way.

A block that applies to some requests only is listed whole, every line of it, because a redirect inside it was never a redirect for everybody: an Nginx if, map or prefix location, and an Apache <If>, <Location>, <Directory>, <Files>, <IfVersion> or <IfModule !...>. That holds whatever the opening line says, a condition with > or >= in it, or one carried on to the next line with a backslash, included. An <IfVersion> block is listed whichever version it names, since this plugin cannot tell which Apache the old server ran. Inside a listed block, only the line that closes it ends it: a stray closing line such as </div>, or a </Files> with no <Files> above it, is listed with the block. A line that starts with < but is not one of Apache's own sections, such as a line of HTML (<div class="note">) or an address in angle brackets (<https://...>, <files.example.com/a.pdf>), is not a block: it is listed on its own and the lines after it are read as usual. A server { } block or a <VirtualHost> is read when its server_name, ServerName or ServerAlias names this site's domain, or when it names none; one for another domain (an old domain, or the www. twin) is listed whole. Comments and the lines that only wrap the file (<IfModule mod_rewrite.c>, RewriteEngine On, http {) are skipped without a word. An <IfModule> or <VirtualHost> opening that holds more than its module or its addresses, such as text after its >, is listed whole instead, because Apache would not read it as a plain wrapper.

A line that ends in a backslash carries on to the next line, and Apache reads the two as one, so the pasted list is read that way too. An opening is decided by all of it: <IfModule \ with !mod_alias.c> on the next line is an <IfModule !...>. The rest of a wrapper's opening is skipped with it. Any other line that a line carries on to is listed, not read on its own, and that includes the line below a comment: below # The old site was in D:\sites\old\, a Redirect line is part of the comment, and Apache never ran it. A backslash with a space after it does not carry on. Nginx does not carry lines on this way. Inside one of its blocks a backslash changes nothing, but at the top of a pasted list the plugin cannot tell Nginx from Apache, so it lists the next line to be safe.

One difference to know. Apache's Redirect /old /new also sends /old/anything to /new/anything. It comes across as /old alone, and the preview says how many lines that applies to. If you relied on it for a whole section, write the line with a slash at the end (Redirect 301 /old/ /new/), and it comes across as the section rule /old/*.

Still stuck? Ask the developers who wrote it. We aim to reply within one business day.