
   RewriteEngine On

    # Redirect www to non-www for /en/ path
    RewriteCond %{HTTP_HOST} ^www\.alzaeemsecurity\.com$ [NC]
    RewriteCond %{REQUEST_URI} ^/en/ [NC]
    RewriteRule ^(.*)$ https://alzaeemsecurity.com/$1 [R=301,L]

    # Redirect URLs containing %7B or %7D to a 404 page
    RewriteCond %{REQUEST_URI} \%7B [NC,OR]
    RewriteCond %{REQUEST_URI} \%7D [NC]
    RewriteRule .* /404 [L]

    # Redirect the base URL to /en/
    RewriteCond %{HTTP_HOST} ^(www\.)?alzaeemsecurity\.com$ [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^$ /en/ [R=301,L]

    # Redirect URLs containing %7B or %7D to a sanitized URL without them
    RewriteCond %{THE_REQUEST} \%7B [NC,OR]
    RewriteCond %{THE_REQUEST} \%7D [NC]
    RewriteRule ^(.*)\%7B(.*)\%7D(.*)$ /$1$2$3 [L,R=301,NE]

    # Standard CodeIgniter rewrite rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]




