404 header

Forum Homepage Forums Community General 404 header

This topic contains 8 replies, has 3 voices, and was last updated by Avatar of Marshall Sorenson Marshall Sorenson 11 months, 3 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1321
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    Hi,
    I think 404 page need to have header('HTTP/1.0 404 Not Found');
    it gives 200 response atm

    #1331
    Avatar of bowe
    bowe
    Participant
    Post count: 698

    I’ve never heard about this before.. Do other WordPress theme add this to the header with conditionals? Could you point me to a resource where this is expected of a WP Theme? I’m happy to implement it if it’s required :-)

    #1350
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    An example info about topic:

    http://www.seomoz.org/learn-seo/http-status-codes

    If a visitor/spider reach a 404 page.. that page need to be 404 status.. not 200

    #1354
    Avatar of bowe
    bowe
    Participant
    Post count: 698

    Yeah but you do you achieve that? I’ve never seen a WordPress theme do this.. Not even the official WordPress themes (twentyten/twentyeleven/_S). I tried to find a code example or technique on how to do this but came up empty.

    #1356
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    i just replaced this:

    <code>infinity_get_header();
    </code>

    with this:

    <code>header('HTTP/1.0 404 Not Found');
    infinity_get_header();
    </code>

    An example 404:

    http://gapvitrin.com/404example

    You can check headers from

    http://www.webconfs.com/http-header-check.php

    Dunno why wp themes not gives 404 status code on 404 pages.. but its necessary imo.

    For example:

    http://www.google.com/404example

    returns: HTTP/1.0 404 Not Found

    http://www.w3.org/404example
    returns: HTTP/1.1 404 Not Found

    #1357
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    Funny think is.. WordPress websites gives 404 too:

    http://en.wordpress.com/404example
    returns: HTTP/1.1 404 Not Found

    http://wordpress.org/404example
    returns: HTTP/1.1 404 Not Found

    For example Matt’s own website:

    http://ma.tt/404example

    returns: HTTP/1.0 404 Not Found

    #1363
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    A WordPress 404 page explanation:

    http://yoast.com/404-error-pages-wordpress/

    > 404 is not only the name, it’s also the HTTP header that the page
    > should send, if not, you might end up with 404 pages in the search
    > engines indexes. You can easily check this with a HTTP header checker.

    #1364
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    oh well..
    It seems its not Infinity’s fault. I was getting 200 response @ 404 pages but it seems its about modifying the main wp_query:

    https://twitter.com/Otto42/status/219884490556841985

    I did a fresh wp install and tried infinity.. it gives successfully 404 error. I will still add header('HTTP/1.0 404 Not Found'); to 404.php for safety because i will modify main wp_query always.

    #1374
    Avatar of Marshall Sorenson
    Marshall Sorenson
    Key Master
    Post count: 565

    Please open a feature request issue on GitHub and I will add support for this in core or with an extension.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.