T
T
topuserman2020-02-13 14:26:54
Slim Framework
topuserman, 2020-02-13 14:26:54

How to properly organize the structure of an mvc project (using the slim framework as an example)?

Installed Slim-framework according to the office. documentation,
via composer put the standard skeleton.

As a result, the following structure appeared on the server (in the DocumentRoot):

app/
vendor/
public/.htpaccess
public/index.php
...


It turns out that when you try to open the site in the browser, the web server does not know that the root of the site (the public part) is the public/ folder , so it opens in the browser this:

5e45322e3112c031264318.jpeg

Do I need to create another .htaccess file with rules?
Or do I need to install the framework somehow differently?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-13
@Tomio

If you have access to the Apache or Nginx settings, then you need to point the server to the root directory. In your case on public .
Otherwise, you can do the same by creating an .htaccess file next to the public folder .
Slim has instructions for setting up application routing on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question