A
A
Andrey Skorchenko2020-09-09 01:46:42
htaccess
Andrey Skorchenko, 2020-09-09 01:46:42

How to configure htaccess to work with API?

5f5802f2a9b82111603105.png
Hello everyone) All my requests go to the /public folder, but separate requests like /api/ should be processed by a php script in the /server/api/index.php folder. With this configuration of the htaccess file, only the main page works, and the api issues 404, if you comment out the last two lines, the api starts working and, accordingly, the main page stops working. What am I doing wrong? What practice is considered better to make the API in the project folder or take it to a subdomain and pull it from there? Who that can advise or give references to esteem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question