HTTP Code 404

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


Required but not found URLs (HTTP code 404)

Statistics for a hosted website are available using cPanel --> Metrics --> Awstats.

Select the Domain, and View. For the selected Month, scroll down to a section headed HTTP Status Codes.

On the current page for this website only code 404 has a link. Apparently there were over 19000 recent 'hits' for which the web server returned HTTP Code 404.

The link on 404 opens the list of page requests which were 'not found'.

According to Awstats a total of 2350 URLs were requested, most of them around 50 times. Stats for the mh370wiki.net website are worse - see below.

Invalid Requests which are WordPress URLs

Many of the requested URLs look like WordPress files, for example:-

  • /Wp-content/admin.php
  • /Wp-includes/customize/chosen.php
  • /Wp-content/themes/about.php
  • /Wp-includes/index.php
  • /Wp-includes/html-api/index.php
  • /Wp-content/languages/index.php
  • /Wp-content/admin-header.php
  • and the list goes on...

I find this annoying, and the web server does not know that these pages are invalid, so my MediaWiki installation has to cope with the request, search the database and inform the web server that the page cannot be found. So I decided (experimentally) to put a stop to it.

The pattern for these WordPress style URLs is reduced to three main directories:-

  • wp-admin
  • wp-content
  • wp-includes

A variant for each directory is a capital W. For each of these directories the files requested can be replaced by a *.

I added the following lines to a .htaccess file:-

RewriteEngine On
# Serve an error without loading a custom page
RewriteRule ^wp-admin(/.*)?$ - [R=404,L]
RewriteRule ^Wp-admin(/.*)?$ - [R=404,L]
RewriteRule ^wp-content(/.*)?$ - [R=404,L]
RewriteRule ^Wp-content(/.*)?$ - [R=404,L]
RewriteRule ^wp-includes(/.*)?$ - [R=404,L]
RewriteRule ^Wp-includes(/.*)?$ - [R=404,L]

Next month when I look at the site metrics I should see a substantial drop in the number of 404 errors and less of these invalid URLs in the list.

Valid Requests for a page not found

Another use for these statistics is to identify pages which are requested and which should be there, or did exist and maybe were moved.

The mh370wiki.net website has undergone several significant structural changes over the development period and I deliberately did not fill the site with Redirects. I believed that if a new version was internally correct and had few if any 'wanted pages' then people browsing the site would rarely be looking for pages that were not there.

That assumption has been reasonably correct but a review of the Error 404 page requests showed about 20 pages which were frequently requested and do not currently exist at that URL (they were moved). The solution was to re-create the page and add a redirect to the current resource.

The syntax is simple:-

#REDIRECT [[pagename]]

Comments can be placed on the page without affecting the redirection. This can be useful to document why the redirect was added and when.

Valid Requests and Searches, not found

Another use for the statistics is to see which Search Keyphrases and Keywords have been requested.

If these requests are valid, consistent with the website topic or content, and a matching resource does not exist, it shows what people want.

The solution is to create a resource that meets the need.


Error 404 and the mh370wiki.net Website

In November 2025 the mh370wiki.net website apparently attracted 409,929 unique visitors, a total of 511,160 hits, and absorbed a bandwidth of 4.23 GB.

Unbelievable! The number of people viewing the site can be estimated from the average duration, the number of views on specific pages, and for interest, the country of origin. Most of the bandwidth was probably used by robots, bots or crawlers. Some of the new AI crawlers made the list in November. Actions were taken!

48 different robots crawled the site, probably accounting for most of the hits.

292,340 hits resulted in an HTTP Status Code 404 (Not Found).

Error 404 for about 20 of the frequently requested pages or URLs can be fixed using redirects - future statistics will show how effective that was.

The next large group of requests are pages /Special:WhatLinksHere which are normally restricted to logged-in users. The odd thing about those requests is that the option is in the Tools Menu and for anonymous users that is not visible at all.

Reviewing trends in search terms and page requests is part of site maintenance.



Articles which relate to HTTP Error Codes

Articles which relate to HTTP Error Codes are included in Category:HTTP Error Codes.

The CategoryTree Extension enables a listing of relevant sub-categories and pages:-



Links

Help:Redirects
https://www.mediawiki.org/wiki/Help:Redirects