Suggest an enhancement to the 404 page


I would like to make a suggestion to enhance the page returned for file not found errors (404). The 3D effect on the picture is quite nice, by the way.

Consider this page, for example:

Recently, the file was renamed cuviddec.c, hence the 404. It would be nice if the returned page included useful links. In this example, that would be: (the owner dashboard) (the corresponding repository) (the history of the file, valid even after the file was renamed)

This would help people who arrived there following an obsolete link from outside to find their way back to something useful.

Expressed as a set of rules, it would be:

If $request_path matches the regexp ^/([^/]+)/ then add a link to /$1/.

If $request_path matches the regexp ^/([^/]+)/([^/]+)/ then add a link to /$1/$2/.

If $request_path matches the regexp ^/([^/]+)/([^/]+)/blob/(.*) then add a link to /$1/$2/commits/$3.

Note that this could be done purely on client side. In fact, once I am done with this mail I will endeavour to write a greasemonkey script or bookmarklet to do just that. But I think it would be more convenient for visitors to have it by default.


Nicolas George

And done with Greasemonkey. Feel free to consider it public domain. But I still think it would be better if it was included by default.

// ==UserScript==
// @name github_404
// @namespace
// @include*
// @version 1
// @grant none
// ==/UserScript==

(function () {

  if (document.title.match(/^Page not found · GitHub/)) {
    var loc = "" + document.location;
    var links = [];
    var m = loc.match(/^(\w+:\/\/[^\/]+)\/([^\/]+)\//);
    if (m)
      links.push({ url: m[1] + "/" + m[2] + "/", label: "User page" });
    var m = loc.match(/^(\w+:\/\/[^\/]+)\/([^\/]+)\/([^\/]+)\//);
    if (m)
      links.push({ url: m[1] + "/" + m[2] + "/" + m[3] + "/",
        label: "Repository" });
    var m = loc.match(/^(\w+:\/\/[^\/]+)\/([^\/]+)\/([^\/]+)\/blob\/(.*)/);
    if (m)
      links.push({ url: m[1] + "/" + m[2] + "/" + m[3] + "/commits/" + m[4],
        label: "File history" });
    var p = document.createElement("p"); = "fixed"; = "1em"; = "1em"; = "solid 1px black"; = "1ex";
    for (var i = 0; i < links.length; i++) {
      if (i > 0)
      var a = document.createElement("a");
      a.href = links[i].url;


Hi @cigaes,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive.

The way that GitHub currently uses 404 errors compensates for a number of different scenarios, including resources that are no longer available, resources that the user does not have access to (to prevent revealing the existance of such resources), and to obscure the inner workings of GitHub itself to increase security. 

However, that does not mean that improvements could not be made and I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

Please let me know if you have any other questions.



Absolutely +1 this! One of the biggest annoyances with using history links in browser that lead to long  gone branches sometimes, is going to the address bar and removing things from the URL to get to the project root page. Would love to have a link “404, but go to the repo root”