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

111
Vistas
How to mod_rewrite / to /frontend/index.html?

I am trying to host both a PHP API and a static/built Angular app on a single Apache server (hosted by SiteGround.com).

Right now I've got this .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
RewriteCond %{REQUEST_URI} !frontend/
RewriteRule ^$ /index.html
RewriteRule ^/$ /index.html
RewriteRule (.*) /frontend/$1 [L]

I assumed the ^$ and ^/$ rules would be enough to make the root of mysite.com to transparently serve /frontend/index.html but i just get a 200 OK response with no content when i browse to mysite.com; however mysite.com/index.html does show my Angular app. I also tried escaping the rule with ^\/$ but that didn't work either.

I also tried making the root rules have higher priority but that didn't work

RewriteEngine on

RewriteRule ^$ /frontend/index.html [L]
RewriteRule ^\/$ /frontend/index.html [L]

RewriteCond %{HTTP_HOST} ^app.apprevenir.com$ [NC]
RewriteCond %{REQUEST_URI} !frontend/
RewriteRule (.*) /frontend/$1 [L]

What's missing from my .htaccess file?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Apparently the rules worked, but SiteGround's NGinx cache was causing the site to ultimately not react to the changed rules.

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