2015-02-06 31 views
0

CodeIgniter中的permit_uri_chars問題。 Followig是我的配置:CodeIgniter中的allowed_uri_chars問題

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-()@!';

按我的config中的特殊符號應該被允許。它適用於符號,但是當我組合使用符號時,它不起作用。

場景:

http://localhost/ci/test/index/page(new).html

當我的URL,正如上文我得到的錯誤:

An Error Was Encountered 

The URI you submitted has disallowed characters. 

但以下的罰款。

http://localhost/ci/test/index/page(new.html 

http://localhost/ci/test/index/pagenew).html 

我該如何解決這個問題?我不想用.htaccess解決這個問題!

回答

2

@TomPHP請在您的配置文件中輸入以下字符。

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-()@!'

你忘了把\在允許系統字符加薪問題的URI。

1

嘗試添加。爲我工作。

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-()@!';