Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-7782

Send HTTP 404 if topic, forum or user do not exist

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.x
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Viewing posts
    • Labels:
      None
    • Environment:
      PHP Environment:
      Database:

      Description

      Currently phpBB shows a "Topic doesn't exist" message when the user tries to open an invalid URL, the URL of a deleted topic or the URL of a topic that's inaccessible to this user. The same goes for forums.

      For bots it would be good if a 404 is returned in these cases because:

      • This makes it easier to erase unwanted information from search engine caches/indices
      • Some bots don't like the fact that random URLs return a 200 statuscode
      • The bot won't need to update the URL (as often) as it would when a 200 is returned
      • It's not very useful to index a "Topic doesn't exist" page

      I've fixed this by adding this around the topic of msg_handler():

              if ($msg_text == 'NO_TOPIC' || $msg_text == 'NO_FORUM')
              {
                      header("HTTP/1.0 404 Not Found");
              }
      

      IMO this is not the cleanest way to fixed this but this saved me quite a bit of work Those two messages are returned in quite a few places...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naderman Nils Adermann
                Reporter:
                BartVB BartVB [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: