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

308
Visualizações
Laravel 8 installation in subfolder

I have a Wordpress installtion on an apache server /var/www/html/.

Within this folder (WP root), I've created a subfolder beta and in this folder have a Laravel 8 installation.

Separately (on a root domain/subdomain), the Laravel installtion works fine, but in my case it doesn't.

The first issue was with the public folder of laravel which looked like mywebsite.com/beta/public. I've fixed this by creating an .htaccess file within the Laravel root folder (/var/www/html/beta/.htaccess):

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

After this move, I can acess the Laravel app without public: mywebsite.com/beta.

Now, I have a problem with the assets because all of them were set relative to home directory (/). Ex. <img src="/images/img.jpg"> + css mix files:

<link rel="stylesheet" href="{{ mix('css/app.css') }}">

I've also updated the APP_URL=https://mywebsite.com/beta within the .env file, but this still doesn't work. Actualy by doesn't work I mean that the website is loaded correctly, but unstyled, which makes sense since in the console all the paths are trying to access the '/css/app.css', '/js/app.js' , 'fonts/font.ttf' , etc.

over 4 years ago · Santiago Trujillo
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