Depending on which tutorial, samples of a request or Postman collection you are using there are two versions for an end point used, note the index.php is not used in the first as was the case in my issue.
http://my.domain/api/v1/content/articles
and
http://my.domain/api/index.php/v1/content/articles
The variation with the index.php
will always work, however it looks odd and I don't believe an API endpoint should have that in its request, while without the index.php
you will need to have these lines that appear in the default htaccess.txt
available in your .htaccess
.
# -- SEF URLs for the API application
# If the requested path starts with /api, the file is not /api/index.php
# and the request has not already been internally rewritten to the
# api/index.php script
RewriteCond %{REQUEST_URI} ^/api/
RewriteCond %{REQUEST_URI} !^/api/index\.php
Note Rewrite ON
is required prior to this.
After I found the cause and knew what to search for, I did find this previous post on JSE that addresses the same issue, Website not correctly displaying "Not Found - The requested URL was not found on this server." , the suggested solution requires you to turn on SEF to get the URL rewrite option which in turn requires you to have a .htaccess file. For my purposes I have SEF turned off.
The solution is simpler, you need to have a .htaccess, the default Joomla one is enough, with the above lines if you want to exclude the index.php
from your requests.