[wp-trac] [WordPress Trac] #44039: attachment rewrite rule redirects to posts instead of showing 404

WordPress Trac noreply at wordpress.org
Thu May 10 17:28:59 UTC 2018


#44039: attachment rewrite rule redirects to posts instead of showing 404
---------------------------+------------------------------
 Reporter:  swedish boy    |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:
 Severity:  minor          |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by SergeyBiryukov):

 Hi @swedish-boy, welcome to WordPress Trac! Thanks for the report.

 > Tested on a clean WordPress-installation running twentyseventeen if you
 visit /hello-world/sample-page/
 > you will be redirected to /sample-page.
 >
 > Is this really how it should be?

 That's WordPress trying to guess the correct URL instead of showing the
 404 error, which may or may not be the expected result, depending on the
 use case.
 See[https://developer.wordpress.org/reference/functions/redirect_guess_404_permalink/
 redirect_guess_404_permalink()].

 Related: #12601.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44039#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list