import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  /* config options here */
  reactCompiler: true,
  trailingSlash: true,
  images: {
    formats: ["image/webp"],
    deviceSizes: [384, 640, 750, 828, 1080, 1200, 1920],
    qualities: [75, 85],
    dangerouslyAllowLocalIP: true,
    remotePatterns: [
      {
        protocol: "https",
        hostname: "clonifynow-live.blr1.digitaloceanspaces.com",
        pathname: "/clonifynow/**",
      },
      // add a CDN hostname here if you use one
    ],
  },
  experimental: {
    optimizeCss: true,
    optimizePackageImports: ["lucide-react", "motion/react", "motion"],
  },
  async redirects() {
    return [
      {
        source: "/blacklanne-clone",
        destination: "/blacklane-clone/",
        permanent: true,
      },
      {
        source: "/tinder-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/tiktok-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/bigolive-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/onlyfans-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/fansly-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/nextdoor-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/badoo-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/hinge-clone/",
        destination: "/",
        permanent: true,
      },
      {
        source: "/pricing",
        destination: "/",
        permanent: true,
      },
      {
        source: "/blabla-clone/",
        destination: "/blablacar-clone/",
        permanent: true,
      },
      // SEO cleanup: old/typo URLs crawled by Google -> live replacement pages (see seo-redirect-plan.csv)
      { source: "/blacklaane-clone", destination: "/blacklane-clone/", permanent: true },
      { source: "/blog", destination: "/blogs/", permanent: true },
      { source: "/blog/category", destination: "/blogs/", permanent: true },
      { source: "/blog/category/rental", destination: "/blogs/", permanent: true },
      { source: "/blog/the-benefits-of-customizable-rental-software-for-small-and-mid-sized-businesses", destination: "/blogs/the-benefits-of-customizable-rental-software-for-small-and-mid-sized-businesses/", permanent: true },
      { source: "/blogs/a-step-by-step-guide-to-implementing-taxi-dispatch-software-for-enhanced-customer-experience", destination: "/blogs/taxi-dispatch-software-implementation-guide/", permanent: true },
      { source: "/blogs/category", destination: "/blogs/", permanent: true },
      { source: "/blogs/category/customer-experience", destination: "/blogs/", permanent: true },
      { source: "/blogs/category/rental", destination: "/blogs/", permanent: true },
      { source: "/blogs/clonifynow.com/blogs/a-guide-to-understanding-important-saas-metrics-for-growth", destination: "/blogs/guide-to-important-saas-metrics/", permanent: true },
      { source: "/blogs/clonifynow.com/blogs/a-guide-to-understanding-important-saas-metrics-for-growth/clonifynow.com", destination: "/blogs/guide-to-important-saas-metrics/", permanent: true },
      { source: "/blogs/cost-to-develop-carpooling-app", destination: "/blogs/cost-to-develop-a-carpooling-app/", permanent: true },
      { source: "/blogs/customer-experience", destination: "/blogs/", permanent: true },
      { source: "/blogs/develop-app-like-uber-how-to-build-a-ride-hailing-app-for-your-own-city", destination: "/blogs/develop-app-like-uber/", permanent: true },
      { source: "/blogs/food-delivery-app-development-growth-strategies-2", destination: "/blogs/food-delivery-app-development-growth-strategies/", permanent: true },
      { source: "/blogs/food-ordering-app-clone-single-restaurant-vs-multi-restaurant-marketplace", destination: "/blogs/food-ordering-app-clone-single-vs-multi-restaurant/", permanent: true },
      { source: "/blogs/how-apps-like-porter-help-you-launch-a-logistics-business-faster", destination: "/blogs/how-apps-like-porter-launch-business/", permanent: true },
      { source: "/blogs/how-to-build-an-app-like-tiktok-the-smart-way-2026-guide", destination: "/blogs/how-to-build-an-app-like-tiktok/", permanent: true },
      { source: "/blogs/how-to-build-on-demand-food-delivery-app", destination: "/blogs/build-on-demand-food-delivery-business/", permanent: true },
      { source: "/blogs/how-to-start-a-luxury-chauffeur-uber-black-car-service-business-in-2029", destination: "/blogs/how-to-start-uber-black-car-service/", permanent: true },
      { source: "/blogs/how-to-start-a-taxi-business-without-owning-cars", destination: "/blogs/start-taxi-business-without-owning-cars/", permanent: true },
      { source: "/blogs/inside-the-saas-business-model-how-does-it-really-work", destination: "/blogs/saas-business-model-guide-2026/", permanent: true },
      { source: "/blogs/page", destination: "/blogs/", permanent: true },
      { source: "/blogs/page/11", destination: "/blogs/", permanent: true },
      { source: "/blogs/page/4", destination: "/blogs/", permanent: true },
      { source: "/blogs/taxi-dispatch-software-implementation-guide-2", destination: "/blogs/taxi-dispatch-software-implementation-guide/", permanent: true },
      { source: "/blogs/what-is-clone-app-how-does-the-clone-app-work", destination: "/blogs/what-is-a-clone-app-and-how-it-works/", permanent: true },
      { source: "/blogs/white-label-taxi-app-vs-custom-app/&sa=D&source=editors&ust=1785396909658376&usg=AOvVaw2q1dk0BtoIxgC2etVlY1ji", destination: "/blogs/white-label-taxi-app-vs-custom-app/", permanent: true },
      { source: "/case-study", destination: "/case-studies/", permanent: true },
      { source: "/category/delivery-management", destination: "/blogs/", permanent: true },
      { source: "/category/delivery-management/page/2", destination: "/blogs/", permanent: true },
      { source: "/category/dispatcher", destination: "/blogs/", permanent: true },
      { source: "/category/startup-solutions", destination: "/blogs/", permanent: true },
      { source: "/custom-portfolio", destination: "/portfolio/", permanent: true },
      { source: "/de/clonifynow-homepage", destination: "/", permanent: true },
      { source: "/de/uber-clone-de", destination: "/uber-clone/", permanent: true },
      { source: "/ecommerce-app-development", destination: "/readyecommerce/", permanent: true },
      { source: "/elementskit_template-sitemap.xml", destination: "/sitemap.xml", permanent: true },
      { source: "/elementskit_widget-sitemap.xml", destination: "/sitemap.xml", permanent: true },
      { source: "/en", destination: "/", permanent: true },
      { source: "/fr/airbnb-clone", destination: "/airbnb-clone/", permanent: true },
      { source: "/laundry-app-development", destination: "/laundry-app/", permanent: true },
      { source: "/llm.txt", destination: "/llms.txt", permanent: true },
      { source: "/llmx.txt", destination: "/llms.txt", permanent: true },
      { source: "/lms-development", destination: "/learning-management-system/", permanent: true },
      { source: "/masseurs-session-booking", destination: "/masseur-session-booking/", permanent: true },
      { source: "/outstation-cab-booking-app-2", destination: "/outstation-cab-booking-app/", permanent: true },
      { source: "/porfolio", destination: "/portfolio/", permanent: true },
      { source: "/pt", destination: "/", permanent: true },
      { source: "/ready-clean", destination: "/ready-service-app/", permanent: true },
      { source: "/ready-restaurant-delivery", destination: "/readyeat-app/", permanent: true },
      { source: "/ready-taxi-app", destination: "/readytaxi-app/", permanent: true },
      { source: "/readycommerce", destination: "/readyecommerce/", permanent: true },
      { source: "/readyrestaurants", destination: "/readyeat-app/", permanent: true },
      { source: "/rental-marketplace-app-2", destination: "/rental-marketplace-app/", permanent: true },
      { source: "/restaurant-management-software", destination: "/restaurant-management-system-with-pos/", permanent: true },
      { source: "/ru/readybnb-ru", destination: "/readybnb/", permanent: true },
      { source: "/sitemap", destination: "/sitemap.xml", permanent: true },
      { source: "/sitemap.html", destination: "/sitemap.xml", permanent: true },
      { source: "/sitemap_index.xml", destination: "/sitemap.xml", permanent: true },
      { source: "/term-and-conditions-zh", destination: "/terms-and-conditions/", permanent: true },
      { source: "/tour-and-travel-app", destination: "/tour-and-travel/", permanent: true },
      { source: "/uberclone", destination: "/uber-clone/", permanent: true },
      { source: "/ubereats", destination: "/uber-eats/", permanent: true },
      { source: "/zh/clonifynow-homepage-zh/https\\:/clonifynow.com/es/clonifynow-homepage-es", destination: "/", permanent: true },
      { source: "/zh/readybnb-zh", destination: "/readybnb/", permanent: true },
      // Legacy WordPress/test URLs from Search Console redirect report
      { source: "/xmlrpc.php", destination: "/", permanent: true },
      { source: "/wp-json/elementskit/v1", destination: "/", permanent: true },
      { source: "/virender", destination: "/", permanent: true },
      { source: "/uber-clon", destination: "/uber-clone/", permanent: true },
      { source: "/suneel-test", destination: "/", permanent: true },
      { source: "/shanni-plugin-development", destination: "/", permanent: true },
      { source: "/sanjay", destination: "/", permanent: true },
      { source: "/sachin-page", destination: "/", permanent: true },
      { source: "/readybroker-app", destination: "/ready-broker-app/", permanent: true },
      { source: "/parcel-delivery-app", destination: "/courier-delivery-app/", permanent: true },
      { source: "/news/digital-platform-mapped-experiences", destination: "/news/", permanent: true },
      { source: "/leads", destination: "/", permanent: true },
      { source: "/lead-manager-listing", destination: "/", permanent: true },
      { source: "/lead-form-page", destination: "/", permanent: true },
      { source: "/form-ajay", destination: "/", permanent: true },
      { source: "/fetch-services", destination: "/", permanent: true },
      { source: "/elementor-18333", destination: "/", permanent: true },
      { source: "/database-setup", destination: "/", permanent: true },
      { source: "/custom-leads-form", destination: "/", permanent: true },
      { source: "/custom-database", destination: "/", permanent: true },
      { source: "/chauffeur-booking-app", destination: "/chauffeur-app/", permanent: true },
      { source: "/blogs/test", destination: "/blogs/", permanent: true },
      { source: "/blogs/page/2", destination: "/blogs/", permanent: true },
      { source: "/blogs/clone-apps-vs-custom-app-development-making-the-right-choice", destination: "/blogs/uber-clone-app-vs-custom-taxi-app/", permanent: true },
      { source: "/blog/what-is-a-clone-app-and-how-it-works", destination: "/blogs/what-is-a-clone-app-and-how-it-works/", permanent: true },
      { source: "/blog/market-timing-2025-why-73-of-vacation-rental-platforms-fail-and-how-to-be-in-the-27", destination: "/blogs/why-vacation-rental-platforms-fail-2025/", permanent: true },
      { source: "/blog/is-your-app-ready-for-apple-vision-pro-and-spatial-computing", destination: "/blogs/app-ready-apple-vision-pro-spatial-computing/", permanent: true },
      { source: "/blog/how-to-launch-your-own-vacation-rental-empire", destination: "/blogs/how-to-launch-your-own-vacation-rental-empire/", permanent: true },
      { source: "/blog/a-step-by-step-guide-to-implementing-taxi-dispatch-software-for-enhanced-customer-experience", destination: "/blogs/taxi-dispatch-software-implementation-guide/", permanent: true },
      { source: "/\\$", destination: "/", permanent: true },
      { source: "/&", destination: "/", permanent: true },
    ];
  },
};

export default nextConfig;
