我正在尝试使用htaccess文件重写e到e。 以下所有规则全部失败。在htaccess中重写utf8字符
RewriteRule ^(.*)é(.*) $1e$2 [R,L]
RewriteRule ^(.*)\xc3\xa9(.*) $1e$2 [R,L]
RewriteRule ^(.*)%C3%A9(.*) $1e$2 [R,L]
我有下面的调试输出,但我无法弄清楚它说什么。
197.178.121.8 - - [24 /二月/ 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 (3)将模式'^(。*)'应用于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] [ (#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)通过/翻译/ 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/2 014:00:29:35 - 0800] [www.speaksheets.com/sid#7ff60b7a0318][rid#7ff60d1edf58/initial](3)[perdir /home/speaksheets.com/public_html/] strip per-dir prefix: /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/初始](3)[perdir /home/speaksheets.com/public_html/]将模式'^ index \ .php $'应用于uri'翻译/ 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/] add p ath info postfix:/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/] strip per-dir prefix:/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。 [3] [perdir /home/speaksheets.com/public_html/]应用模式'。' to'uri'翻译/ 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/] rewrite'translation/how-to-say-bon-app \ xc3 \ xa9tit-in-french-bon-appetit /' - >'/ index。php'
问题是,这条规则有什么问题,RewriteRule ^(.*)\xc3\xa9(.*) $1e$2 [R,L]
?
你是对的,我写它作为第一条规则,现在它的工作完美 – hyena
你能否提供完整的'''.htaccess'''去除''''index.php'''形式的url? – kishor10d
评论部分用于讨论问题或发布答案,而不是询问新代码。你应该发布一个包含所有细节的新问题。 – anubhava