mod_rewrite和编码参数

时间:2017-08-24 10:03:13

标签: javascript apache mod-rewrite url-encoding

我正在研究在PHP上运行的API。 我想以格式发送请求

<Expander Header="{Binding Path=lblOverallInt}">
    <Expander.HeaderTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Label Name="lbl2" Content="{Binding}"/>
            </StackPanel>
        </DataTemplate>
    </Expander.HeaderTemplate>
</Expander>

一直有效,直到我点击包含/字符的参数地址。它在逻辑上将保存的数据转移到了数据库中。

所以我在从Javacript

提交数据之前完成了encodeURIComponent
http://localhost/crm/api/addCustomer/John/Doe/Address 123/...

现在,当我尝试调用API时,我找不到404对象。

这是我当前带编码数据的网址

address = encodeURIComponent(getVal("address")); 

这是我的.htaccess

http://localhost/crm/api/addCustomer/John/Doe/Address%202166%2F62/.....

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

AllowEncodedSlashes Nodecode放入虚拟主机配置中:

<VirtualHost *:80>
    ServerName ...
    DocumentRoot ...
    AllowEncodedSlashes Nodecode
    ...
相关问题