Strange, while turning the options and plugins on and off to seek the exact cause while looking at the plugin code, it stopped working. I continued debugging and found out the following oddities about both 404 Redirected and Smart 404 without requiring the other to be activated at the same time. May not apply with permalink structure of
With 404 Redirected activated, regardless of Smart 404:
/?p=[anynumber] is shown in logs as a 404 error with the intended target URL
/, and is redirected to
/anypostname/?p=[anynumber] redirects to the URL so that
? and everything after it is removed. Essentially same as above.
These work when either the page URL ending in
/ has been visited shortly before with
Create automatic redirects on. After the first visit, this option can be turned off and the URL +
?p=[number] will still redirect to it.
Examples: When setting on, visit
/postname/?p=anynumber, no matter if you turn the setting then off or leave it on, visit
/postname/?p=anyothernumber, you get redirected to
/postname/. When setting off, visit
/postname/?p=anynumber, no matter if you turn the setting then on or leave it off, visit
/anotherpostname/?p=anyothernumber, you get a 404 error or if Smart 404 is on, you get an endless redirection loop. See more below.
If the URL variable is anything else than
?p=anynumber, the results are different. Not worth analyzing in this post, as possibly any trouble with them would be solved at the same time as the above.
With 404 Redirected deactivated and Smart 404 deactivated:
/?p=[number] redirects to the post with that number, if one exists, if not, gives a 404 error message.
/postname/?p=[number] also redirects to the post with that number, if one exists, if not, gives a 404 error message.
With 404 Redirected deactivated and Smart 404 activated:
/?p=[number] redirects to the post with that number, if one exists, if not, gives a 404 error message. Just as with Smart 404 deactivated. But:
/postname/?p=[number] gives the endless redirection loop Graham described in his original post.