Answer the question
In order to leave comments, you need to log in
How to get rid of public/index.php in Laravel URL?
Allocated a separate api.example.com domain for all requests. At the root are project folders, one of them decided to try writing in Laravel.
The structure looks like this:
api.example.com
project_1
project_2
api.example.com/project/
api.example.com/project/public/index.php/
api.example.com/project/
api.example.com/project/public/index.php
Answer the question
In order to leave comments, you need to log in
Thanks for the answers, the solution was to start via server.php in the root of the project.
To get rid of public/index.php, you need to direct the DocumentRoot to the public/ folder (obviously).
If for some reason you do not want to change the DocumentRoot, then you can do the following:
- Move the project1, project2 folders FOR DocumentRoot (generally a stupid idea to put the project code in the DocumentRoot)
- Make symlinks from /path/to/project2/public to DocumentRoot/ project2
- In app.php, write the correct path to the site so that laravel correctly generates the url
- ???
- Rejoice in success.
What do you advise?It's ok to set up a web server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question