<IfModule mod_rewrite.c>
    RewriteEngine On

    # Redirect /index, /index.php, or /lionheart-v3/ to /lionheart-v3
    RewriteCond %{THE_REQUEST} \s/lionheart-v3/(index(\.php)?|/)\s [NC]
    RewriteRule ^ /lionheart-v3 [R=301,L]
    
    # If the request is for a file or directory that exists, serve it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    # Rewrite /about to /about.php, etc.
    RewriteRule ^([a-zA-Z0-9_-]+)$ $1.php [L]
    
    # Optionally, rewrite the root to index.php
    DirectoryIndex index.php
</IfModule>