Apache mod_speling 不区分大小写的 URL 问题
我想使用 Apache 的 mod_speling
模块获得不区分大小写的 URL,但这会产生不需要的“多个选项”列表,而 Apache 文档说
设置后,该指令将拼写更正操作限制为小写/大写更改。不执行其他可能的更正。
我正在 Apache 2.2.16 Unix 全新安装上对此进行测试,但我仍然遇到与 2008 年提交的问题完全相同的问题。
当 Apache 列出一些“多项选择”(状态代码)时,这是意外(且不想要)的行为[300] 当 checkCaseOnly 指令开启时!
我的 httpd.conf
中有这样的内容:
CheckSpelling on
CheckCaseOnly on
第一个指令使用 mod_speling
,第二个指令仅限制大小写
更正 我做错了什么?
I want to have case insensitive URLs using Apache's mod_speling
module, but this is producing unwanted lists of "multiple options" whilst the Apache documention says
When set, this directive limits the action of the spelling correction to lower/upper case changes. Other potential corrections are not performed.
I'm testing this on an Apache 2.2.16 Unix fresh install but I'm still running into exact the same problems as submitted in 2008.
It's unexpected (and not wanted) behaviour when Apache lists a few "multiple choices" (status code 300) when the checkCaseOnly directive is on!
I have this in my httpd.conf
:
CheckSpelling on
CheckCaseOnly on
First directive to use the mod_speling
, second directive to limit only to case corrections
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
TLDR:CheckCaseOnly 已被破坏,因为截至 2014 年 10 月 10 日,该错误已超过六年未修复。
我知道这是一个老问题,但我刚刚遇到了同样的问题。此更新是为了帮助其他人解决同样的问题。
这个问题的当前答案是不正确的,因为OP正确使用了mod_speling,但是有一个错误。
https://issues.apache.org/bugzilla/show_bug.cgi?id=44221 根本问题
是 apache 人员对于修复此行为存在分歧,因为它改变了模块的其余部分。这个问题已经有六年没有解决了。
TLDR: CheckCaseOnly is broken due to a bug that has remained unfixed for over six years as of 10/2014.
I know this is an old question, but I just ran into the same issue. This update is to help others with the same issue.
The current answers to this question are incorrect, as the OP is using mod_speling correctly, but there is a bug.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44221
The underlying issue is that the apache people are in disagreement over fixing this behavior because it changes the rest of the module. This has remained unfixed for something like 6 years.
要启用 mod_speling(通过 Location 或 VirtualHost),请使用指令:
如果您想要的是不区分大小写,请使用:
您还需要启用 RewriteEngine:
To enable mod_speling (either by Location or VirtualHost) use the directive:
If all you want is case insensitivity use:
You also need to have RewriteEngine enabled:
在使用 Apache 2.2 的 Ubuntu 12.04 LTS 上,我执行了以下操作:
在
${APACHE}/mods-available
中创建speling.conf
以提供配置选项。< /p>将
speling.conf
和speling.load
链接到启用的模块目录${APACHE}/mods-enabled
:重新启动服务器。
On Ubuntu 12.04 LTS using Apache 2.2, I did the following:
Create
speling.conf
in${APACHE}/mods-available
to provide the config options.Link
speling.conf
andspeling.load
into the enabled modules directory${APACHE}/mods-enabled
:Restart the server.
在阅读了 user1647075 的回答,了解这是一个不太可能修复的已知 Apache bug 后,我决定最好的选择是隐藏通过更新我的 Apache 配置来显示 300 状态代码的 404 错误页面,从用户处获取“多个选项”页面:
当然,您也可以创建自定义错误页面,而不是重复使用 404 错误页面。
希望这个解决方法有帮助。
After reading user1647075's answer about this being a known Apache bug that's unlikely to be fixed, I decided my best option was to hide the "multiple options" page from the user by updating my Apache config to show the 404 error page for 300 status codes:
Of course, you can also create a custom error page instead of reusing the 404 error page.
Hope this workaround helps.
您真的想要不区分大小写的 URL 吗?
为什么不像这样强制使用小写网址呢?
看看 http://www.issociate.de/board/post/265865/make_URL
Do you really want case insensitive URL?
Why not just force lowercase urls, like this?
Have a look at http://www.issociate.de/board/post/265865/make_URL