Home  >  Q&A  >  body text

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

This is my question, I have the following structure:

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

I have coded using the built in php server so when I run php -S localhost:3000 everything runs smoothly but when I upload it to my vps or run it using apache in my local machine When my backend is not initialized, even Postman can access my endpoint.

I know maybe the configuration on htaccess can solve it, but I don't know how to do it, the whole scenario:

I visit my root directory (http://localhost:3000) to load my index.html On javascript it sends the request to http://localhost:3000/api/uri When my server runs on the built-in server, it gets all the data from the backend and returns it to my frontend perfectly

thanks for your help

P粉194919082P粉194919082170 days ago3489

reply all(1)I'll reply

  • P粉596161915

    P粉5961619152024-04-06 00:49:49

    I just added the .htaccess from lavarel e and everything works fine, it looks like there is a problem reading the route system I created.

    reply
    0
  • Cancelreply