2013-11-20 91 views
0

我在Apache上使用Rewrite时遇到了一些问题。 我重写就是这样(一个老笨):用下划线替换URL中的点

RewriteCond $1 !(index\.php|index\.html) 
RewriteRule ^(.*)$ index.php?/$1%{QUERY_STRING} [QSA] 

如果我通过这样的URL:

http://server.fr/seg1/seg2/email/[email protected]/other/1.3 

如果我在我的索引的开始日志$ _GET瓦尔。 PHP的,我有这样的:

array(2) { 
    ["email"]=> 
    string(10) "[email protected]_fr" 
    ["other"]=> 
    string(3) "1_3" 
} 

不明白为什么所有的点被替换... 任何想法表示欢迎!

感谢

+2

PHP是通过设计完成的。 http://us2.php.net/variables.external –

+0

这正是我在想的,点是无效的字符。并转换为下划线。 @AnthonySterling –

+0

@AnthonySterling - 在参数**名称**中,不是值: - ? –

回答

1

This thread建议如下解决办法:更换

$config['uri_protocol'] = 'AUTO'; 

...到...

$config['uri_protocol'] = 'REQUEST_URI'; 

在config.php文件。

+0

谢谢!我在网上搜索,但没有找到答案... – Amoeba