Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

335
Visualizações
Symfony project works only homepage. When I navigate to the other pages Apache returns 404

A have symfony5 project. When I hosted to server I changed the default host path from https://example.com to https://example.com/public, because index.php is in /public folder. From then my site works only on the homepage. When I navigate to the other pages Apache returns 404. "The requested URL /bio/ was not found on this server". Everything works on localhost but not on the host.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You should change the DocumentRoot on Apache to point to the public folder and therefore, the url will point to the public folder without it being present in your url.

Here is an example of a VirtualHost Apache allowing you to listen to the website.loc url and point to the public folder linked to this website (it may not be complete):

<VirtualHost *:80>
    DocumentRoot "/path/to/website/public/" 
    ServerName webiste.loc
    DirectoryIndex index.php

    ErrorLog "/var/log/httpd/error_log"
    CustomLog "/var/log/httpd/access_log" common


    <Directory "/path/to/website/public/">
        AllowOverride none
        Order allow,deny
        Allow from all
        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]
        </IfModule>
    </Directory>
</VirtualHost>

If it doesn't work, can you give us the configuration of your VirtualHost on Apache? Watch out for sensitive info that may be present.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda