[wp-trac] [WordPress Trac] #56312: Appending ?name to home URL shows the posts page instead of a static front page (was: WordPress bug with rewrite rule)

WordPress Trac noreply at wordpress.org
Sat Jul 30 14:41:40 UTC 2022


#56312: Appending ?name to home URL shows the posts page instead of a static front
page
------------------------------------------+-----------------------------
 Reporter:  masimoti                      |       Owner:  (none)
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Query                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * keywords:   => needs-patch needs-unit-tests
 * component:  General => Query
 * milestone:  Awaiting Review => Future Release


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the ticket.

 Replying to [ticket:56312 masimoti]:
 > Can you explan the logic behind it why should we show another thing like
 latest post when someone enter some parameter ?

 I suspect this is because `name` is one of the
 [https://codex.wordpress.org/Reserved_Terms reserved terms] in WordPress,
 which specifically refers to a post slug, and since a post with an empty
 slug cannot be found, the query defaults to the posts page.

 This sounds like an issue with should be able to fix. I was able to
 reproduce it on a clean install:
 * On Reading Settings screen, assign a static front page and a posts page.
 * Go to the home URL and check that the static front page is displayed.
 * Append the `?name` parameter to the URL.
 * Now the posts page is displayed instead of the static front page.

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


More information about the wp-trac mailing list