Author Topic: 404 Status on Missing Topics/Boards v2.1  (Read 3755 times)

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
404 Status on Missing Topics/Boards v2.1
« on: Nov 03, 2014, 01:54:05 AM »

404 STATUS ON MISSING BOARDS/TOPICS v2.1
By Dougiefresh -> Link to Mod


Introduction
This mod makes a minor change to the forum to return HTML error codes when topics and boards are missing or inaccessible.

Per Arantor's suggestion in his post, error handling has been changed so that:
=> Board number too high returns 404 (Not Found)
=> Deleted boards return 410 (Gone)
=> Inaccessible boards return 403 (Forbidden)
=> Topic number too high returns 404 (Not Found)
=> Deleted topics return 410 (Gone)
=> Inaccessible topics return 403 (Forbidden)

By definition, a 404 error code (Not Found) is this:
Quote
The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.
A 410 error code (Gone) is this:
Quote
Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally removed and the resource should be purged. Upon receiving a 410 status code, the client should not request the resource again in the future. Clients such as search engines should remove the resource from their indices. [citation needed] Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
A 403 error code (Forbidden) is this:
Quote
The request was a valid request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no difference. On servers where authentication is required, this commonly means that the provided credentials were successfully authenticated but that the credentials still do not grant the client permission to access the resource (e.g. a recognized user attempting to access restricted content).

Admin Settings
There are no admin settings.  To disable it, you must remove this mod.

Related Discussion
o Is there a way to disable specific URL

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1 thru 3, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Copyright (c) 2015, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: Jan 09, 2016, 10:09:21 AM by dougiefresh »

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Re: 404 Status on Missing Topics/Boards v1.2
« Reply #1 on: Nov 03, 2014, 01:54:06 AM »

Download Mod


FileName: 404_on_Missing_Topics_Boards_v2.1.zip
Size: 5 kb (4,871 bytes)
MD5: 90cd1f044d7b77d34cc064f837d48cfa
Built: Jul 22, 2017, 10:50:40 AM
Downloaded 84 times

Changelog

Uploaded v2.1 - July 5th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 1 and 2.

Uploaded v2.0 - September 20th, 2016
o Per Arantor's suggestion, error handling has been changed so that:
=> Deleted boards return 410 (Gone)
=> Inaccessible boards return 403 (Forbidden)
=> Board number too high returns 404 (Not Found)
=> Deleted topics return 410 (Gone)
=> Inaccessible topics return 403 (Forbidden)
=> Topic number too high returns 404 (Not Found)

Uploaded v1.2 - April 6th, 2015
o Updated for SMF 2.1 Beta 1

Uploaded v1.1 - January 16th, 2015
o License change to Simplified BSD.  No functionality change.

Uploaded v1.0 - November 3rd, 2014
o Initial Release of the mod
« Last Edit: Oct 29, 2016, 08:19:21 PM by dougiefresh »