命名参数中的CakePHP加号解码为空格
当命名参数的值包含字符命名参数中的CakePHP加号解码为空格,cakephp,named,Cakephp,Named,当命名参数的值包含字符+(加号)时,这是命名参数值的问题 网址是 当我尝试var\u dump指定的参数(在本例中是number)时,字符+变成一个空格 string(14) " 6581235251237" 字符+为%2B,更改url时结果相同: http://localhost/kidwatcher/messages/sentbox/number:%2B6581235251237 string(14) " 6581235251237" 但当我使用url查询字符串时,它是有效的 http
+
(加号)时,这是命名参数值的问题
网址是
当我尝试var\u dump
指定的参数(在本例中是number
)时,字符+
变成一个空格
string(14) " 6581235251237"
字符+
为%2B
,更改url时结果相同:
http://localhost/kidwatcher/messages/sentbox/number:%2B6581235251237
string(14) " 6581235251237"
但当我使用url查询字符串时,它是有效的
http://localhost/kidwatcher/messages/sentbox?number=%2B6581235251237
string(14) "+6581235251237"
命名参数有什么问题?好的,现在我有了这个问题的解决方案 文件夹app/webroot中 编辑.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L,B]
</IfModule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php?url=$1[QSA,L,B]