RewriteEngine on

# Extensionless PHP URLs
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]

# Block only known bad bots (minimal list)
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*(bot|crawl|spider|scrape|scan|zgrab|masscan|sqlmap|nikto|nmap).*$ [NC]
RewriteRule .* - [F,L]

# Prevent directory listing
Options -Indexes

# Default index
DirectoryIndex index.php


