Changing “Front page displays” to static page breaks 404 routing
-
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_optionsvalues: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.
The topic ‘Changing “Front page displays” to static page breaks 404 routing’ is closed to new replies.