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

113
Visualizações
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 Respostas
Responde à pergunta

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 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