Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

186
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda