gpt4 book ai didi

.htaccess 区分大小写和 mod_rewrite

转载 作者:行者123 更新时间:2023-12-02 10:43:57 24 4
gpt4 key购买 nike

我的.htaccess:

RewriteEngine On
CheckCaseOnly On
CheckSpelling On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^Blog/(.*?)$ /Me/profile.php?username=$1 [QSA,L]

问题是,当 URL 是这样的时候,它就可以工作:

localhost/Me/Blog/ExampleUser

但是当它像这样时它不起作用(注意“Blog”中的“b”是小写的?):

localhost/Me/blog/ExampleUser

我正在新版本的 XAMPP 上运行它。奇怪的是,即使我的 PHP 配置中有 mod_speling.so,它也不起作用。

问题是什么?

最佳答案

Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive manner. That is, it doesn't care whether letters appear as upper-case or lower-case in the matched URI.

尝试[QSA,L,NC],这样就可以进行比较 in a case-insensitive manner

关于.htaccess 区分大小写和 mod_rewrite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16579652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com