Symfony Application Publication (production)

Asked

Viewed 8 times

0

Hello, I am new to development on Symfony and am publishing an application for the first time on a hosting on hostgator. I’m using version 5.2.

I’ve already added the project files to hosting, installed the dependencies via Composer but when accessing the project it lists all the files in the directory and does not run the project as it should. If I click on the plasta public it carries the home.

Below follows how it appears when accessing the project.

Thank you in advance for your help.

inserir a descrição da imagem aqui

1 answer

-1

I had the same problem at the hostgator. I did the following: I created two .htaccess. One at the root and one at public

.htaccess at the Root:

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

.htaccess in public:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.