# .htaccess for public_html root
# Upload this file to: public_html/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Redirect root to frontend
    RewriteRule ^$ /frontend/ [L,R=301]
    RewriteRule ^index\.html$ /frontend/ [L,R=301]

    # Don't touch backend requests
    RewriteCond %{REQUEST_URI} ^/backend/
    RewriteRule ^ - [L]

    # Don't touch existing files/folders
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Redirect everything else to frontend
    RewriteCond %{REQUEST_URI} !^/frontend/
    RewriteRule ^(.*)$ /frontend/$1 [L,R=301]
</IfModule>

# Disable directory listing
Options -Indexes
