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

185
Visualizações
Remove public from url lumen

I'm working on an microservice based arhitecture with Lumen. The local environement is working fine, but the production server needs adjustments, because it can't have the same link structure, and I want the code to be the same in every env.

In the local env I created virtual hosts for every microservice, like for e.g. books.xyz, and authors.xyz that point to the /public folder, so link structure DOESN'T contain public. On live, it is hosted like server .servername.com/books and beta.servername.com/authors. I have started developing an admin panel with lumen ( /admin ) but the problem is that the link structure is too different, and doesn't work on production. ( css/js assets get 404'd etc.)

How can I remove the /public in the production URL?

I don't want to move everything from public folder into root, because of security reasons!

I have tried creating a .htaccess file on the root, and the following, but none of them worked :

# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_URI} !^/books/public/
# RewriteRule ^(.*)$ /public/$1 [L,QSA]
# RewriteRule ^game/(.*)$ /books/public/$1 [L,QSA]
# </IfModule>

or

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

or

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ books/public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
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