So I installed OSticket and built an API which worked perfectly on one server. Moved it to a new host and now I'm getting a 404 error. I did some tweaking with .htaccess in the /api folder and it returned a 200 OK, however did not actually create a ticket. So I know the problem is somehow related to the .htaccess file.
The .htaccess file for the /api/ directory is as follows:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.*/api)
RewriteRule ^(.*)$ %1/http.php/$1 [L]
</IfModule>
The URL of my api is: https://website.com/ost/api/tickets.json
When I used a URL rewrite checker it said the corrected url returned:
https://website.com/ost/api/http.php/ost/api/tickets.json
So I can see the problem is it's adding /ost/api/ twice to the URL. I've tried and tried and I cannot work out the Regex to fix this. Anyone have an ideas?