使用 .htaccess 使单词不区分大小写
Make a word insensitive case with .htaccess
我有这个 .htaccess 规则。
# Shop-homepage
RewriteRule ABCDEF/fr-CA/$ shop-homepage.php?lang=fr&country=ca&shop=ABCDEF [L,QSA]
RewriteRule ABCDEF/en-CA/$ shop-homepage.php?lang=en&country=ca&shop=ABCDEF [L,QSA]
RewriteRule ABCDEF/en-US/$ shop-homepage.php?lang=en&country=us&shop=ABCDEF [L,QSA]
如何使 ABCDEF
不区分大小写?
谢谢。
使用NC
标志。 NC 用于匹配 URI 中的大小写字符:
RewriteRule ABCDEF/fr-CA/$ shop-homepage.php?lang=fr&country=ca&shop=ABCDEF [L,QSA,NC]
RewriteRule ABCDEF/en-CA/$ shop-homepage.php?lang=en&country=ca&shop=ABCDEF [L,QSA,NC]
RewriteRule ABCDEF/en-US/$ shop-homepage.php?lang=en&country=us&shop=ABCDEF [L,QSA,NC]
我有这个 .htaccess 规则。
# Shop-homepage
RewriteRule ABCDEF/fr-CA/$ shop-homepage.php?lang=fr&country=ca&shop=ABCDEF [L,QSA]
RewriteRule ABCDEF/en-CA/$ shop-homepage.php?lang=en&country=ca&shop=ABCDEF [L,QSA]
RewriteRule ABCDEF/en-US/$ shop-homepage.php?lang=en&country=us&shop=ABCDEF [L,QSA]
如何使 ABCDEF
不区分大小写?
谢谢。
使用NC
标志。 NC 用于匹配 URI 中的大小写字符:
RewriteRule ABCDEF/fr-CA/$ shop-homepage.php?lang=fr&country=ca&shop=ABCDEF [L,QSA,NC]
RewriteRule ABCDEF/en-CA/$ shop-homepage.php?lang=en&country=ca&shop=ABCDEF [L,QSA,NC]
RewriteRule ABCDEF/en-US/$ shop-homepage.php?lang=en&country=us&shop=ABCDEF [L,QSA,NC]