Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/admincp/$ [NC]
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9-_\/]+)/?$ index.php?page=$1&subpage=$2&request=$3 [QSA]
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ index.php?page=$1&subpage=$2 [QSA]
RewriteRule ^([a-zA-Z0-9]+)/?$ index.php?page=$1 [QSA]

<IfModule mod_rewrite.c>
	# Bloquear scrapers / rippers (HTTrack, Wget, etc.)
	RewriteCond %{HTTP_USER_AGENT} (httrack|wget|libwww-perl|scrapy|teleport|webcopy|webzip|sitesucker|webreaper|webcollage|blackwidow|webwhacker|websauger|webdownloader|webcopier|webripper|netants|nikto|sqlmap|masscan|zgrab|grabber) [NC]
	RewriteRule ^(.*)$ - [F,L]
</IfModule>

<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|sql|bak|zip|rar|7z|env)$">
	Require all denied
</FilesMatch>

<FilesMatch "(?i)nexora\.local\.php$">
    Require all denied
</FilesMatch>

# Nexora Speed V4 — compresion de respuestas de texto.
# Brotli cuando el hosting lo soporta; DEFLATE solo como fallback.
<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/css text/xml application/javascript application/json application/xml image/svg+xml
</IfModule>
<IfModule !mod_brotli.c>
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/javascript application/json application/xml image/svg+xml
    </IfModule>
</IfModule>
