.htaccess - htaccess 重写规则 - 允许在 URL 中使用大写字母

标签 .htaccess mod-rewrite

我有以下重写规则:

RewriteEngine On
RewriteRule ^brand/([0-9a-zA-Z-]+)/?$ find_by_brand.php?brand=$1
RewriteCond %{THE_REQUEST} find_by_brand\.php
RewriteRule ^find_by_brand\.php - [F]

如果我去 /Michelin//michelin/,我希望它能够工作

有谁知道我可以添加什么来实现它?

谢谢!

最佳答案

添加[NC]标志(“无大小写”)

RewriteRule ^brand/([0-9a-zA-Z-]+)/?$ find_by_brand.php?brand=$1 [NC,L]

关于.htaccess - htaccess 重写规则 - 允许在 URL 中使用大写字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7730587/

相关文章:

wordpress 网站有多个重定向

apache - 如何解决 .htaccess RewriteRule 冲突?

.htaccess - 使用 .htaccess 作为友好的 url

apache - 重定向所有以 "/"结尾的 url

apache - 重写 : Leading dot in the cookie domain

angularjs - 如果 url 不包含特定路径,则应用重写规则

.htaccess - 为多个域和 SSL 配置 .htaccess

node.js - 如何使用 .htaccess 在 Apache 后面运行我的 NodeJS 服务器?

.htaccess - 来自子文件夹的主机域

apache - 如何使用 .htaccess 将某些 url 重定向到端口