Why is there a file named .extended-spelling-corrections in my website directory?

Some hosting customers who have been with us for more than a decade may notice a file named .extended-spelling-corrections in their website directory. The presence of this file makes our web servers use “extended spelling correction” when trying to locate filenames that don’t exist.

What is “extended spelling correction”?

Extended spelling correction goes beyond our normal system of fixing miscapitalizations in URLs and tries to fix certain other URL errors. It currently fixes these two situations:

  • A URL ending in .htm is requested, but the filename actually ends with .html (or vice-versa);
  • A URL including a hyphen is requested, but the filename actually contains an underscore (or vice-versa).

For example, if a request is made for file.htm but the file is actually named file.html, that will be fixed. Similarly, if a request is made for file-123.htm but the file is actually named file_123.htm, that will be fixed.

What additional things did “extended spelling correction” previously fix?

Before May 2017, it used to also try to fix transpositions, missing characters, and other character substitutions. This may sound like a beneficial feature, but some of the things it did could be very surprising. For example, if the web server received a request for http://example.com/file2.html, but file2.html didn’t exist because you forgot to upload it, the extended spelling correction feature might display file1.html or file3.html instead, seemingly at random and with no indication that anything was wrong. That’s not what you want, especially because the “fix” might prevent you from noticing the problem unless you were looking closely.

Similarly, if a page embedded an image called product1.png but only product2.png existed on the server, it would silently display the second image to the visitor instead. That might cause a shopper to see an incorrect product image on a website, which is probably worse than seeing an error message.

Because of the surprising results this feature caused, we stopped enabling any kind of extended spelling correction for customers who signed up for our web hosting service after May 2005. It was still enabled for customers who signed up with us before then, though.

In May 2017, we disabled all corrections except the two mentioned above, even for longtime customers still using this feature. But before we did that, we manually logged all corrections it had made on existing sites over several months, then duplicated those corrections in the site’s .htaccess file. For example, if extended spelling correction had been changing requests for a nonexistent page12.htm to page11.htm, we added a line like this:

Redirect 301 /page12.htm /page11.htm

It’s difficult to know if that’s what’s “supposed” to happen, but it matches what was happening previously. It ensures that any customers who were relying on this feature will get the benefit of existing “corrections”, without any newly added incorrect URLs being wrongly “corrected”.

Should I do anything if I still use this feature?

Nobody should rely on this feature, and it will be completely removed in the future. It’s much better to fix bad links instead (and possibly use a custom 404 error page if you're concerned about bad links from other sites). We’d recommend deleting the .extended-spelling-corrections file from your site and fixing any broken links properly.