I have an application built with CodeIgniter that a 3rd party service (an email service provider) is making http requests containing POST data to when certain events occur. The problem is, the url that this 3rd party service is making the requests to is not fully modifiable by me, specifically, it make its requests to a file named w_4.php
at the domain and directory that I specify.
Instead of having this separate file outside of the CodeIgnitier stack, I would like to, using .htaccess, rewrite all the requests made for this file to a controller within my codeigniter application, i.e. api/my_controller/my_method
. But I need the POST data in the request intact, so I would think a redirect could not be used.
I tried something like this in my .htaccess:
RewriteCond $1 (w_4\.php)
RewriteRule ^(.*)$ index.php/api/my_controller/my_method
While the request does get routed to codeigniter, I just get a 404 even though that controller/route does exist.