Skip to content

Instantly share code, notes, and snippets.

@gabcarvalhogama
Created September 12, 2025 02:59
Show Gist options
  • Select an option

  • Save gabcarvalhogama/a2b0e8786a3ced9f13cb959bacab721d to your computer and use it in GitHub Desktop.

Select an option

Save gabcarvalhogama/a2b0e8786a3ced9f13cb959bacab721d to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Se o arquivo ou diretório existir, serve normalmente
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Caso contrário, redireciona tudo para o index.html
RewriteRule ^ index.html [L]
</IfModule>
# Opcional: cache de arquivos estáticos
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment