<?php
/**
 * Legacy URL Redirects for HVAC Community Events
 *
 * This file contains redirect rules that can be added to .htaccess
 * or used as a reference for server-level redirects
 *
 * @package HVAC_Community_Events
 * @since 1.0.0
 */

// Legacy redirect rules for .htaccess (Apache)
/*
# HVAC Community Events Legacy Redirects
# Add these rules to your .htaccess file above the WordPress rules

RedirectMatch 301 ^/community-login/?$ /training-login/
RedirectMatch 301 ^/hvac-dashboard/?$ /trainer/dashboard/
RedirectMatch 301 ^/master-dashboard/?$ /master-trainer/master-dashboard/
RedirectMatch 301 ^/manage-event/?$ /trainer/event/manage/
RedirectMatch 301 ^/trainer-profile/?$ /trainer/my-profile/
RedirectMatch 301 ^/event-summary/?$ /trainer/event/summary/
RedirectMatch 301 ^/email-attendees/?$ /trainer/email-attendees/
RedirectMatch 301 ^/certificate-reports/?$ /trainer/certificate-reports/
RedirectMatch 301 ^/generate-certificates/?$ /trainer/generate-certificates/
RedirectMatch 301 ^/certificate-fix/?$ /master-trainer/certificate-fix/
RedirectMatch 301 ^/hvac-documentation/?$ /trainer/documentation/
RedirectMatch 301 ^/attendee-profile/?$ /trainer/attendee-profile/
RedirectMatch 301 ^/google-sheets/?$ /master-trainer/google-sheets/
RedirectMatch 301 ^/communication-templates/?$ /trainer/communication-templates/
# NOTE: Master trainer communication-templates should NOT redirect - they use /master-trainer/communication-templates/
RedirectMatch 301 ^/communication-schedules/?$ /trainer/communication-schedules/
RedirectMatch 301 ^/trainer-registration/?$ /trainer/registration/
*/

// Legacy redirect rules for Nginx
/*
# HVAC Community Events Legacy Redirects
# Add these rules to your Nginx server block

location = /community-login { return 301 /training-login/; }
location = /community-login/ { return 301 /training-login/; }
location = /hvac-dashboard { return 301 /trainer/dashboard/; }
location = /hvac-dashboard/ { return 301 /trainer/dashboard/; }
location = /master-dashboard { return 301 /master-trainer/master-dashboard/; }
location = /master-dashboard/ { return 301 /master-trainer/master-dashboard/; }
location = /manage-event { return 301 /trainer/event/manage/; }
location = /manage-event/ { return 301 /trainer/event/manage/; }
location = /trainer-profile { return 301 /trainer/my-profile/; }
location = /trainer-profile/ { return 301 /trainer/my-profile/; }
location = /event-summary { return 301 /trainer/event/summary/; }
location = /event-summary/ { return 301 /trainer/event/summary/; }
location = /email-attendees { return 301 /trainer/email-attendees/; }
location = /email-attendees/ { return 301 /trainer/email-attendees/; }
location = /certificate-reports { return 301 /trainer/certificate-reports/; }
location = /certificate-reports/ { return 301 /trainer/certificate-reports/; }
location = /generate-certificates { return 301 /trainer/generate-certificates/; }
location = /generate-certificates/ { return 301 /trainer/generate-certificates/; }
location = /certificate-fix { return 301 /master-trainer/certificate-fix/; }
location = /certificate-fix/ { return 301 /master-trainer/certificate-fix/; }
location = /hvac-documentation { return 301 /trainer/documentation/; }
location = /hvac-documentation/ { return 301 /trainer/documentation/; }
location = /attendee-profile { return 301 /trainer/attendee-profile/; }
location = /attendee-profile/ { return 301 /trainer/attendee-profile/; }
location = /google-sheets { return 301 /master-trainer/google-sheets/; }
location = /google-sheets/ { return 301 /master-trainer/google-sheets/; }
# FIXED: Only redirect exact /communication-templates, not URLs containing it
location = /communication-templates { return 301 /trainer/communication-templates/; }
location = /communication-templates/ { return 301 /trainer/communication-templates/; }
# NOTE: /master-trainer/communication-templates/ should NOT be redirected
location = /communication-schedules { return 301 /trainer/communication-schedules/; }
location = /communication-schedules/ { return 301 /trainer/communication-schedules/; }
location = /trainer-registration { return 301 /trainer/registration/; }
location = /trainer-registration/ { return 301 /trainer/registration/; }
*/