Guest User

Untitled

a guest
May 26th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. function checkCoupon(str){
  2.  
  3. if (window.XMLHttpRequest) {
  4. // code for IE7+, Firefox, Chrome, Opera, Safari
  5. xmlhttp=new XMLHttpRequest();
  6. } else { // code for IE6, IE5
  7. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  8. }
  9. xmlhttp.onreadystatechange=function() {
  10. if (this.readyState==4 && this.status==200) {
  11. alert('success');
  12. }
  13. }
  14.  
  15. xmlhttp.open("GET","https://www.example.com/inc/checkCoupon?id=45&coupon="+str,true);
  16.  
  17. xmlhttp.send();
  18. }
  19.  
  20. #Rewrite everything to https
  21. RewriteEngine On
  22. RewriteCond %{HTTPS} !=on
  23. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  24.  
  25. RewriteCond %{HTTP_HOST} !^www. [NC]
  26. RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  27.  
  28. RewriteCond %{HTTPS} !=on
  29. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  30.  
  31. RewriteBase /
  32. RewriteCond %{REQUEST_FILENAME} !-f
  33. RewriteCond %{REQUEST_URI} !(.*)/$
  34. RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]
Add Comment
Please, Sign In to add comment