mod_rewrite的 - 改变URL的情况下 [英] mod_rewrite - change URL case

查看:190
本文介绍了mod_rewrite的 - 改变URL的情况下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有改变使用mod_rewrite任何URL的情况下,任何简单的方法?

Is there any straightforward way to change the case of any URL using mod_rewrite?

我认为这是pretty琐碎......显然不是。

I thought this was pretty trivial... apparently not.

例如:

http://example.com/id

http://example.com/ID

http://example.com/id/123

http://example.com/ID/123

和等等。

推荐答案

mod_rewrite的有一定的内部功能你可以使用一个映射。其中之一是 TOUPPER 的转换字母为大写:

mod_rewrite has some internal functions you can use for a mapping. One of them is toupper that converts letters to uppercase:

RewriteMap uppercase int:toupper

RewriteRule [a-z] %{uppercase:%{REQUEST_URI}} [L,R=301]

这篇关于mod_rewrite的 - 改变URL的情况下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆