esp/.htaccess

28 lines
883 B
ApacheConf

# En la raíz del proyecto
<IfModule mod_headers.c>
<Files "index.php">
Header set Cache-Control "no-cache"
</Files>
</IfModule>
<IfModule mod_deflate.c>
# No comprimir router API ni el stream SSE (rompe event-stream)
SetEnvIfNoCase Request_URI "api/index.php" no-gzip=1
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# No reescribir archivos o directorios existentes
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# API: /api/ -> api/index.php y /api/<ruta> -> api/index.php?r=<ruta>
RewriteRule ^api/?$ api/index.php [L,QSA]
RewriteRule ^api/([A-Za-z0-9_\-]+)/?$ api/index.php?r=$1 [L,QSA]
# Páginas: raíz y vistas conocidas a index.php con view
RewriteRule ^$ index.php [L,QSA]
RewriteRule ^(home|dashboard|nocache|puertos|flash|programacion)/?$ index.php?view=$1 [L,QSA]
</IfModule>