export default defineEventHandler((event) => {
  const path = getRequestURL(event).pathname

  if (path.startsWith('/lire')) {
    const rest = path.slice(5) // remove '/lire'
    return sendRedirect(event, `/modele-eco${rest || '/'}`, 301)
  }

  if (path.startsWith('/ecouter')) {
    const rest = path.slice(8) // remove '/ecouter'
    return sendRedirect(event, `/en-musique${rest || '/'}`, 301)
  }
})
