The cause is a default rule in the .htaccess Maker’s Server Protection, and you can work around it right now with a few lines of custom code. This is not a mistake in how you configured the .htaccess Maker.
Why this happens
By default, Server Protection allows direct access to static files of certain types (including PDF) inside certain directories (including images). It does so by telling Apache “serve this file directly and stop processing any further rules”. That is fine for files that exist. When the file has been deleted, Apache still stops there, finds nothing to serve, and answers with its own bare 404 “Object not found!” page. The request never reaches Joomla, which is why no URL is recorded in Joomla’s Redirects component and why the Admin Tools redirections have no effect. Joomla’s stock .htaccess file does not have this rule, which is why it works with that file. Disabling the Admin Tools plugin makes no difference, because this rule lives in the .htaccess file, not in the plugin.
Adding images/documents to the “Allow direct access” lists could not have helped, as the default rule above already applies to your PDFs. Please do not remove images or pdf from the front-end lists as a workaround: that would make Server Protection block your existing PDFs with a 403 error.
This is what we believe is going on, based on reading how the .htaccess Maker generates its rules. We have not seen your .htaccess file, so we cannot be absolutely certain. The test in step 4 below will tell you.
How to make Joomla handle deleted files in images/documents
Go to Components, Admin Tools, .htaccess Maker.
In Custom .htaccess rules at the top of the file add the following three lines. If the field already has content, add them on new lines after it:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^images/documents/ index.php [L,NC]
Click on Save and Create .htaccess in the toolbar.
Visit the URL of one of the deleted PDFs in your browser. You should now see your site’s own 404 page (or, if you have already set up a redirect, you will be redirected) instead of the bare “Object not found!” message.
Create your redirects, either in Components, Admin Tools, SEO and Migration, URL Redirections, or in Joomla’s Redirects component.
These rules only apply to URLs under images/documents/ which do not correspond to an existing file or directory. Existing files continue to be served directly, and Server Protection continues to work as before for everything else. If you need the same for another directory, change images/documents/ to that directory’s path, or add one more such set of three lines per directory.
If step 4 still shows the bare “Object not found!” page, please reply with the full contents of your site’s current .htaccess file. Something other than the default rule is then responsible, and we need to see it.
What we are doing about this
We are adding an option to the .htaccess Maker’s Server Protection, “Accessing non-existent files (frontend)”, and a matching one for the backend. The default will remain the current behaviour (the server returns HTTP 404 Not Found). Choosing “Joomla handles them” will make Apache pass requests for missing files to Joomla, which does the same thing as the custom code above, without you having to write it. I cannot give you a release date for it yet. Until then, the custom code above does the job and will keep working after the option arrives.
Moira Fari
Support Specialist
🇬🇧English: native 🕐 My time zone is Asia / Nicosia
Kindly note that my replies are fully vetted by our developers.