#Impedir que se pueda ver el listado de contenidos de un directorio
AddDefaultCharset UTF-8
Options All -Indexes




#URLS AMIGABLES
# Activar RewriteEngine
DirectoryIndex index.php
RewriteEngine on



#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteRule ^(\w+)$ index.php?action=$1
RewriteRule ^(\w+)/?$ index.php?action=$1

RewriteRule ^([a-zA-Z0-9_-]+)?$ index.php?action=$1
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?action=$1

RewriteRule ^publicaciones/([a-zA-Z0-9_-]+)?$ index.php?action=$1
RewriteRule ^publicaciones/([a-zA-Z0-9_-]+)/?$ index.php?action=$1


RewriteRule ^variantes/([a-zA-Z0-9_-]+)/?$ index.php?action=$1
RewriteRule ^variantes/([a-zA-Z0-9_-]+)/?$ index.php?action=$1


<IfModule mod_expires.c>
  ExpiresActive On
  # Establece expiración de 5 minutos para archivos HTML, CSS, JS
  ExpiresByType text/html "access plus 5 minutes"
  ExpiresByType text/css "access plus 5 minutes"
  ExpiresByType application/javascript "access plus 5 minutes"
  ExpiresByType application/x-javascript "access plus 5 minutes"
</IfModule>

<IfModule mod_headers.c>
  # Control de caché adicional
  <FilesMatch "\.(html|css|js)$">
    Header set Cache-Control "max-age=300, must-revalidate"
  </FilesMatch>
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
