Options -Indexes
RewriteEngine On
RewriteBase /icostruct/

# Remove .php from URLs
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
RewriteRule ^ %1 [R=301,L]

# Route clean URLs to PHP files
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

# Homepage fallback
DirectoryIndex index.php
