Context: I have Cakephp v2.3 and I'm running XAMPP. My directory structure is thus:
C:\xampp\htdocs\cakephp\app\webroot
I have a .htaccess file located in ..\xampp\htdocs that redirects to cakephp (so basically I can type localhost and it will redirect me to localhost/cakephp)
This could be the root of my issue, but its the only way I was able to get cake to work.
Given this, everything was working fine UNTIL... Posting with Ajax over SSL.
Problem: The Ajax request originates from an https page and posts to another https page (so it's not a domain issue). The manifestation of the problem is the Post changing to a "Get" and dropping the posted data. If I make the request a "Get" it works fine (but I don't want to do that because it's posting data in the truest sense). If I make both actions use http it works. I believe this redirect is occurring because Apache is re-writing "/action" to "/cakephp/action"
What's Confusing: I have debugs in the CakePhp before filter and when I put a return in that method (the beforeFilter) my Client side Developer Tools say the request was Post, all the data was present, and the server response is my debug line. When I put the return as the first line in the target action the problem manifests (IE: the client tools show the request as being a Get with no data and the initiator is the target action instead of a jQuery command).
This confuses me because once it gets into the beforeFilter I would ASSUME Apache no longer redirects it. And I also assume, per the CakeBook Documentation, that the next method called after beforeFilter completes is the target Action. But for some reason, between the beforeFilter completing and the targetAction starting the request is redirected to /cakephp/action
Relevant Code:
.htaccess at ..\xampp\htdocs
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ cakephp/app/webroot/ [L]
RewriteRule (.*) cakephp/app/webroot/$1 [L]
</IfModule>
Thanks in advance to any brave helpers!