Although Alleyvate disables attachment pages (see #64), core's default behavior of redirecting attachment URLs to their corresponding files is still enabled. We should disable that behavior, too, so that attachments have no bearing on how frontend requests are routed.
Use Case
When a user visits a URL that matches an attachment's post_name, they should receive a 404 instead of being redirected to the file.
Description
Although Alleyvate disables attachment pages (see #64), core's default behavior of redirecting attachment URLs to their corresponding files is still enabled. We should disable that behavior, too, so that attachments have no bearing on how frontend requests are routed.
Use Case
When a user visits a URL that matches an attachment's
post_name
, they should receive a 404 instead of being redirected to the file.