多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# Apache模块 mod_speling | [说明](#calibre_link-11) | 自动纠正URL中的拼写错误 | | --- | --- | | [状态](#calibre_link-12) | 扩展(E) | | [模块名](#calibre_link-13) | speling_module | | [源文件](#calibre_link-14) | mod_speling.c | ### 概述 Requests to documents sometimes cannot be served by the core apache server because the request was misspelled or miscapitalized. This module addresses this problem by trying to find a matching document, even after all other modules gave up. It does its work by comparing each document name in the requested directory against the requested document name **without regard to case**, and allowing **up to one misspelling** (character insertion / omission / transposition or wrong character). A list is built with all document names which were matched using this strategy. If, after scanning the directory, * no matching document was found, Apache will proceed as usual and return a "document not found" error. * only one document is found that "almost" matches the request, then it is returned in the form of a redirection response. * more than one document with a close match was found, then the list of the matches is returned to the client, and the client can select the correct candidate. ## CheckSpelling 指令 | [说明](#calibre_link-18) | Enables the spelling module | | --- | --- | | [语法](#calibre_link-19) | `CheckSpelling on&#124;off` | | [默认值](#calibre_link-24) | `CheckSpelling Off` | | [作用域](#calibre_link-20) | server config, virtual host, directory, .htaccess | | [覆盖项](#calibre_link-66) | Options | | [状态](#calibre_link-21) | 扩展(E) | | [模块](#calibre_link-22) | mod_speling | | [兼容性](#calibre_link-137) | CheckSpelling was available as a separately available module for Apache 1.1, but was limited to miscapitalizations. As of Apache 1.3, it is part of the Apache distribution. Prior to Apache 1.3.2, the `CheckSpelling` directive was only available in the "server" and "virtual host" contexts. | This directive enables or disables the spelling module. When enabled, keep in mind that * the directory scan which is necessary for the spelling correction will have an impact on the server's performance when many spelling corrections have to be performed at the same time. * the document trees should not contain sensitive files which could be matched inadvertently by a spelling "correction". * the module is unable to correct misspelled user names (as in `http://my.host/~apahce/`), just file names or directory names. * spelling corrections apply strictly to existing files, so a request for the `<Location /status>` may get incorrectly treated as the negotiated file "`/stats.html`". mod_speling should not be enabled in [DAV](#calibre_link-510) enabled directories, because it will try to "spell fix" newly created resource names against existing filenames, e.g., when trying to upload a new document `doc43.html` it might redirect to an existing document `doc34.html`, which is not what was intended.