【发布时间】:2014-03-25 18:39:21
【问题描述】:
我正在尝试使用 htaccess 文件将 é 重写为 e。 以下所有规则都失败了。
RewriteRule ^(.*)é(.*) $1e$2 [R,L]
RewriteRule ^(.*)\xc3\xa9(.*) $1e$2 [R,L]
RewriteRule ^(.*)%C3%A9(.*) $1e$2 [R,L]
我有以下调试输出,但是我无法弄清楚它在说什么。
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (2) 请求初始化重写引擎uri /translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) 应用模式 '^( .*)' to uri '/translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/'
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) 应用模式 '^( .*)' to uri '/translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/'
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (1) 通过 /translation/ how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 添加路径信息后缀:/home/speaksheets.com/public_html/translation -> /home/speaksheets.com/public_html/translation/how-to-say-bon-app\xc3\xa9tit-in -french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 去除每个目录前缀:/home/speaksheets.com/public_html/translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/ -> 翻译/ how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 将模式 '^index\.php$' 应用于 uri 'translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/'
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 添加路径信息后缀:/home/speaksheets.com/public_html/translation -> /home/speaksheets.com/public_html/translation/how-to-say-bon-app\xc3\xa9tit-in -french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 去除每个目录前缀:/home/speaksheets.com/public_html/translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/ -> 翻译/ how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (3) [perdir /home/ speaksheets.com/public_html/] 应用模式“。” to uri 'translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/'
197.178.121.8 - - [24/Feb/2014:00:29:35 --0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial] (2) [perdir /home/ speaksheets.com/public_html/] 重写 'translation/how-to-say-bon-app\xc3\xa9tit-in-french-bon-appetit/' -> '/index.php'
问题是,这条规则有什么问题,RewriteRule ^(.*)\xc3\xa9(.*) $1e$2 [R,L]?
【问题讨论】:
标签: apache .htaccess mod-rewrite utf-8