Search code examples
javascriptphpapache.htaccessserver-configuration

How configure apache to load index.html and index.php?


here is my doubt, I have the following structure:

root/index.html root/api/index.php

I have coded with the php built in server, so when I run php -S localhost:3000 everything runs smooth but when I updload it to my vps or run it with apache in my localmachine my backend is not initialized and even the postman can acccess my endpoints.

I know maybe a configuration on htaccess can solve it, but I have no idea how to do it, the whole scenario:

I access my root (http://localhost:3000) that loads my index.html on javascript it sends requests to http://localhost:3000/api/uri when my server is running on php built in server it fetch all the data on back end that returns to my front end all perfectly

thanks for your help


Solution

  • I just added .htaccess from lavarel e all worked, looks like it had a problem reading the route system I created.