# Enable Rewrite Engine
RewriteEngine On

# Ensure correct base directory
DirectoryIndex index.html

# Redirect old URLs to new URLs (Permanent 301)
Redirect 301 /events https://www.wizard-events.in/event-management
Redirect 301 /employeeengagement https://www.wizard-events.in/employee-engagement
Redirect 301 /mice https://www.wizard-events.in/mice-company-delhi
Redirect 301 /mice-company https://www.wizard-events.in/mice-company-delhi
Redirect 301 /digitalservices https://www.wizard-events.in/digital-services

# Remove .html from URLs (EXCLUDE corporate-gifts.html)
RewriteCond %{THE_REQUEST} /\S+\.html [NC]
RewriteRule ^(.*)\.html$ /$1 [R=301,L]

# Automatically serve .html files if requested without an extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L]

# Ensure requests to /corporate-gifts/ load index.html inside the folder
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^corporate-gifts/?$ /corporate-gifts/index.html [L]

