<IfModule mod_rewrite.c>
    # Enable rewrite engine
    RewriteEngine On

    # Handle Authorization Header (useful for APIs or other authentication mechanisms)
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect trailing slashes to avoid double slashes in URLs (except if it's a folder)
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # If the request is to the root (e.g., https://abouhamdan.com/), redirect to public/index.php
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ /public/$1 [L]


    # Disable MultiViews and Indexes if mod_negotiation is available
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    # Optional: Add headers if needed (example for cross-origin resource sharing, etc.)
    <IfModule mod_headers.c>
        # Example of setting headers, you can add your own if needed
        # Header set Access-Control-Allow-Origin "*"
    </IfModule>

</IfModule>

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 52.169.18.25

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit