# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# Añadir una regla para manejar enlaces permanentes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

# Seguridad adicional
# Proteger el archivo wp-config.php
<Files wp-config.php>
order allow,deny
deny from all
</Files>

# Deshabilitar exploración de directorios
Options -Indexes

# Proteger .htaccess de accesos externos
<Files .htaccess>
order allow,deny
deny from all
</Files>

# Bloquear XML-RPC (para reducir ataques)
<Files xmlrpc.php>
order allow,deny
deny from all
</Files>

# Habilitar compresión Gzip para mejorar velocidad
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</IfModule>
