# # Enable Rewrite Engine for Angular Routing
# <IfModule mod_rewrite.c>
#     RewriteEngine On
#     RewriteBase /chatbot/admin/

#     # Allow direct access to existing files and directories
#     RewriteCond %{REQUEST_FILENAME} -f [OR]
#     RewriteCond %{REQUEST_FILENAME} -d
#     RewriteRule ^ - [L]

#     # Redirect all other requests to index.html (for Angular SPA)
#     RewriteRule ^.*$ /chatbot/admin/index.html [QSA,L]
# </IfModule>

# # Fix MIME Type Issues
# <IfModule mod_mime.c>
#     AddType application/javascript .js
#     AddType text/javascript .js
#     AddType text/css .css
#     AddType application/json .json
# </IfModule>

# # Fix Caching Issues
# <IfModule mod_expires.c>
#     ExpiresActive On
#     ExpiresByType application/javascript "access plus 1 year"
#     ExpiresByType text/css "access plus 1 year"
#     ExpiresByType image/png "access plus 1 year"
# </IfModule>

# # Redirect 404 Errors to Angular App
# ErrorDocument 404 /chatbot/admin/


<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /BookSlot

    # Allow direct access to existing files and directories
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Redirect all other requests to index.html (for Angular SPA)
    RewriteRule ^.*$ /BookSlot/index.html [L]
</IfModule>

# Ensure proper MIME types
<IfModule mod_mime.c>
    AddType application/javascript .js
    AddType text/javascript .js
    AddType text/css .css
    AddType application/json .json
    AddType image/svg+xml .svg
</IfModule>

# Handle 404 errors by redirecting to Angular app
ErrorDocument 404 /BookSlot/index.html
