0

I am using contact form 7 to send an URL from one form to other using on_sent_ok. Trying to send http://myurl.com in the query string redirects me to the 403 forbidden page. On some research, I found it a mod_secrity causing the issue. Can it be done without turning the mod_security off?

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.

More if this mod is turned off, will it be fixed as I have many sites hosted.

Manashvi Birla
  • 2,837
  • 3
  • 14
  • 28

1 Answers1

0

You need to encode the string using encodeURIComponent when using an complete url in query strings.

on_sent_ok: "location ='http://example.com/somepage/?u='+encodeURIComponent(jQuery('#url').val());"
Rahil Wazir
  • 10,007
  • 11
  • 42
  • 64