title: jQuery POST 404 not found issue due to http://
body: <p>I have this script, I have no issue to add to cart in my local development machine.</p>
  
  <p>in the Customization Link: * textbox, I need to pass a full URL. e.g
  <a href="http://www.google.com" rel="nofollow">http://www.google.com</a></p>
  
  <p>In local machine, I have not issue to add to cart, but in this live server, in inspect show that POST 404 not found.</p>
  
  <p>However, if I remove the <strong>http://</strong> in the text box, it is able to add to cart. (e.g www.google.com)</p>
  
  <p>Anyone what wrong with the server or the script problem?</p>
  
  <p>The only part to catch the clink is below code:</p>
  
  <pre><code>var clink = getParameterByName('clink');
  if(clink != '')
  {
      $("div.options input[name^='option']").val(clink);
  }
  
     //get query string value 
  function getParameterByName(name) {
          name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
          var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"),
              results = regex.exec(location.search);
          return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
      }
  </code></pre>
  
  <p>Now the problem is the ajax add to cart is not working if the input with http://, if you run in inspect mode, u can see POST 404 error. Other page does not have this issue.</p>
  
  <p>Local Server:
  OS: Windows
  PHP: 5.4.36
  Apache: 2.4.10
  mySql: 5.5.40</p>
  
  <p>Production Server:
  OS: Linux (cPanel)
  Apache Version  2.2.29
  PHP Version 5.3.29
  MySQL Version   5.5.42-cll
  Architecture    x86_64
  Operating System    linux</p>
  
  <p>ajax for add to cart</p>
  
  <pre><code>$('#button-cart').bind('click', function() {
      $.ajax({
          url: 'index.php?route=cart/add',
          type: 'post',
          data: $('#product-main input[type=\'text\'], #product-main input[type=\'hidden\'], #product-main input[type=\'radio\']:checked, #product-main input[type=\'checkbox\']:checked, #product-main select, #product-main textarea'),
          dataType: 'json',
          success: function(json) {
              $('.success, .warning, .attention, information, .error').remove();
  
              if (json['error']) {
                  if (json['error']['option']) {
                      for (i in json['error']['option']) {
                          $('#option-' + i).after('&lt;span class="error"&gt;' + json['error']['option'][i] + '&lt;/span&gt;');
                      }
                  }
  
                  if (json['error']['profile']) {
                      $('select[name="profile_id"]').after('&lt;span class="error"&gt;' + json['error']['profile'] + '&lt;/span&gt;');
                  }
              } 
  
              if (json['success']) {
                  addProductNotice(json['title'], json['thumb'], json['success'], 'success');
                  $('#cart-total').html(json['total']); 
                  $('#cart_content').load('index.php?route=module/cart #cart_content &gt; *');
              }   
          }
      });
  });
  </code></pre>
  
  <p>Set the header for the Content-type: application/json on server side. Still not working.</p>