I updated Wordpress on my website the other day and I was met with difficulties with custom permalinks and XMLHttpRequest (yes I'm not using Jquery's .load() Ajax function).
So after several google searches, it turned out that everyone was having this problem and I couldn't find an appropriate solution.
Problem:
I initiated a XMLHttpRequest object named xmlhttp.
Now this next line used to work before I updated Wordpress:
xmlhttp.open("GET","http://www.mywebsite.com/etc/etc/myPhpFile.php?q=" +str, true);
where the "str" value gets sent from a click event on a label - so imagine I click a label named myLabel so I get str = myLabel in this example.
This was working perfectly before I updated Wordpress and the catch is that it was working with custom permalinks.
Now if I set custom permalinks, I get a 404 Not Found on http://www.mywebsite.com/etc/etc/myPhpFile.php?q=myLabel
Alternatively, if I change Wordpress's Permalinks to Default, everything works fine again and I get Ajax results from myPhpFile.
So the problem is basically that setting custom permalinks in my updated version of Wordpress is causing the url in my XMLHttpRequest.open object to be 404 Not Found!
P.S: I really need to stick to my old custom permalinks and not revert to the default one for my Ajax calls to work.
So after several google searches, it turned out that everyone was having this problem and I couldn't find an appropriate solution.
Problem:
I initiated a XMLHttpRequest object named xmlhttp.
Now this next line used to work before I updated Wordpress:
xmlhttp.open("GET","http://www.mywebsite.com/etc/etc/myPhpFile.php?q=" +str, true);
where the "str" value gets sent from a click event on a label - so imagine I click a label named myLabel so I get str = myLabel in this example.
This was working perfectly before I updated Wordpress and the catch is that it was working with custom permalinks.
Now if I set custom permalinks, I get a 404 Not Found on http://www.mywebsite.com/etc/etc/myPhpFile.php?q=myLabel
Alternatively, if I change Wordpress's Permalinks to Default, everything works fine again and I get Ajax results from myPhpFile.
So the problem is basically that setting custom permalinks in my updated version of Wordpress is causing the url in my XMLHttpRequest.open object to be 404 Not Found!
P.S: I really need to stick to my old custom permalinks and not revert to the default one for my Ajax calls to work.