Timeline for Non existing blog pages are not redirected to 404
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 21, 2012 at 18:26 | comment | added | dashaluna |
Thanks Dave, that does makes sense. I'm guessing the home.php is similar in that sense then.
|
|
Mar 21, 2012 at 15:25 | comment | added | Dave Hunt | The index.php is often used as a fallback, as it is the last template in the hierarchy for all of the Wordpress views. | |
Mar 20, 2012 at 20:04 | comment | added | dashaluna |
I'm using the 'standard' query for the blog, not custom. Also, my pagination doesn't do anything fancy, it constructs the same URL is prev/next entries using get_pagenum_link() . Thanks for looking at it more, it still feels strange that this is the default behaviour.. oh well.
|
|
Mar 20, 2012 at 14:03 | comment | added | Dave Hunt | After looking into it a bit more, it looks like it is also the default behaviour when running any kind of query in index.php | |
Mar 20, 2012 at 14:02 | history | edited | Dave Hunt | CC BY-SA 3.0 |
added 19 characters in body
|
Mar 20, 2012 at 13:00 | history | edited | Dave Hunt | CC BY-SA 3.0 |
added 69 characters in body
|
Mar 20, 2012 at 12:58 | comment | added | Dave Hunt | Sorry I should've been more clear. It is the default behaviour when running a custom query, since you are feeding in the $paged variable yourself. If you let it use the default query behaviour for whatever template you are using (like a category page) then it should figure it out on its own. | |
Mar 20, 2012 at 12:36 | comment | added | dashaluna | Yes, that's right, the category pages with non-existent page number gets redirected to 404. But not the main Blog non-existent pages.. Does that make sense? I've tried to describe it in the main question. I would thought it would be the same, but it doesn't seem to trigger 404 in the latter case. | |
Mar 20, 2012 at 12:24 | comment | added | fuxia♦ | The link leads to a category page without posts. It's a 404 … because that is the default behavior. | |
Mar 20, 2012 at 12:19 | comment | added | dashaluna | @toscho, yes it somehow doesn't feel like a default behaviour.. It would be nice to know why that's happening. Hm, I'm not sure what I'm looking at at that link? :S | |
Mar 20, 2012 at 12:08 | comment | added | fuxia♦ | This is not the default behavior. Try ma.tt/category/meta/page/20 :D | |
Mar 20, 2012 at 11:34 | comment | added | dashaluna |
Also, I was wondering if the following statements do the same thing: $wp_query->is_404 = true; and $GLOBALS['wp_query']->is_404 = true; and $wp_query->set_404(); Does it make difference which one to use? Similarly, are these the same as well: status_header(404); and header("HTTP/1.0 404 Not Found"); and whether it makes difference to use them? Thanks!
|
|
Mar 20, 2012 at 11:32 | vote | accept | dashaluna | ||
Mar 20, 2012 at 11:20 | comment | added | dashaluna | Wow, I'm impressed that it's a default WP behavior. Surely this is one of the top scenarios for a blog with a page being set up as "Posts Page". Gonna try your solution now. Thanks! | |
Mar 19, 2012 at 20:22 | history | answered | Dave Hunt | CC BY-SA 3.0 |