简体   繁体   English

如何在不使用mod_security的情况下允许在查询字符串中使用http?

[英]How to Allow http in query string without using mod_security?

I am using contact form 7 to send an URL from one form to other using on_sent_ok . 我正在使用联系表单7使用on_sent_ok从一个表单向另一个表单发送URL。 Trying to send http://myurl.com in the query string redirects me to the 403 forbidden page. 尝试在查询字符串中发送http://myurl.com会将我重定向到403禁止页面。 On some research, I found it a mod_secrity causing the issue. 在一些研究中,我发现它是导致问题的mod_secrity Can it be done without turning the mod_security off? 是否可以在不关闭mod_security下完成?

This is my code for contact 这是我的联系方式

on_sent_ok: "location ='http://example.com/somepage/?u='+jQuery('#url').val();"

where #url is the input for the url. 其中#url是网址的输入。

More if this mod is turned off, will it be fixed as I have many sites hosted. 如果此mod已关闭,更多信息将被修复,因为我托管了许多站点。

在查询字符串中使用完整的url时,需要使用encodeURIComponent对该字符串进行编码。

on_sent_ok: "location ='http://example.com/somepage/?u='+encodeURIComponent(jQuery('#url').val());"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM