• Resolved lance_mountain

    (@lance_mountain)


    What I was doing:
    I set “Front page displays” in Settings -> Reading to “A static page (select below)” with a content page.

    What I expected to happen:
    When I type a bogus URL, like /abalsdkjg, I expect the 404 page to appear.

    What actually happened:
    I get redirected to a content page (not a post). If I delete that page, it goes the next page (it appears to be going to the last added post ID that is a “page” type rather than “post”).

    If I go back into Settings -> Reading and change it back to “Your latest posts” everything works normally. Also, if I delete all “pages” the 404 works as expected.

    Details:

    • WordPress version 2.5.1 (revision 7918 checked out from http://svn.automattic.com/wordpress/tags/2.5.1)
    • Database version: 7796
    • wp_options values: show_on_front = page, page_on_front = 8
    • No plugins activated.
    • I am using the default theme, and the 404 theme file is intact and working.
    • WordPress is installed in a subdirectory (/wp).

    What I tried:
    I tried switching to other themes, and had the same result. I chmodded my .htaccess file, and also updated the Permalinks via the WP Admin “Permalinks” form.
    I tried all the suggestions here.

    One thing I thought might be the issue is in the rewrite_rules column for wp_posts. This last value:
    s:18:"(.+?)(/[0-9]+)?/?$";
    s:47:"index.php?pagename=$matches[1]&page=$matches[2]";}

    Maybe that last rewrite rule is matching anything and sending it to the “page” instead of to the 404. It seems to be matching anything, not just existing page names.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have exactly the same issue with several installations on different servers of WP 2.5.1.

    If one types a wrong URL, all pages, if a static page is defined as home page, are shown at the same time, one after the other – which is probably some heavy server load.

    rereading me .. voilà some more info :

    I have tried that on different machines (Linux, Windows) with different versions of Apache/PHP, with different permalink structures (actually using /%year%/%monthnum%/%postname%/).

    I also have tried creating a 404 page.

    However the problem must be due either to rewrite conditions either to the mighty WP loop. (Those looping pages one after the other instead of a 404.. there is no order I could understand (not ID, not date of creation, not date of modification), seems rather random to me).

    I just found some strange solution, which I do NOT understand but which works :

    In the Reading options you selected a static page to be your home page. If you select another page in the other select (article page).. then.. strangely it works.

    Maybe somebody can explain it though?

    Thread Starter lance_mountain

    (@lance_mountain)

    I searched the WordPress Trac tickets (http://trac.wordpress.org/) and found that a ticket is already opened for this — it looks like the fix will be in the 2.5.2 release.

    Ticket: http://trac.wordpress.org/ticket/6539

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing “Front page displays” to static page breaks 404 routing’ is closed to new replies.